aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smpboot.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2017-02-05 05:50:21 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-14 18:25:41 -0500
commit6e306c5907a075ba6d46f6ee33c689abf4bfb733 (patch)
tree33010f75e8480fa78ebb1b4bf674bb3a375cf8c0 /arch/x86/kernel/smpboot.c
parentc3cc4259f8322fef4f59e719b05b07bc6833d8f9 (diff)
x86/CPU/AMD: Bring back Compute Unit ID
commit 79a8b9aa388b0620cc1d525d7c0f0d9a8a85e08e upstream. Commit: a33d331761bc ("x86/CPU/AMD: Fix Bulldozer topology") restored the initial approach we had with the Fam15h topology of enumerating CU (Compute Unit) threads as cores. And this is still correct - they're beefier than HT threads but still have some shared functionality. Our current approach has a problem with the Mad Max Steam game, for example. Yves Dionne reported a certain "choppiness" while playing on v4.9.5. That problem stems most likely from the fact that the CU threads share resources within one CU and when we schedule to a thread of a different compute unit, this incurs latency due to migrating the working set to a different CU through the caches. When the thread siblings mask mirrors that aspect of the CUs and threads, the scheduler pays attention to it and tries to schedule within one CU first. Which takes care of the latency, of course. Reported-by: Yves Dionne <yves.dionne@gmail.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Brice Goglin <Brice.Goglin@inria.fr> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yazen Ghannam <yazen.ghannam@amd.com> Link: http://lkml.kernel.org/r/20170205105022.8705-1-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r--arch/x86/kernel/smpboot.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index e9bbe02950ad..36171bcd91f8 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -423,9 +423,15 @@ static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
423 int cpu1 = c->cpu_index, cpu2 = o->cpu_index; 423 int cpu1 = c->cpu_index, cpu2 = o->cpu_index;
424 424
425 if (c->phys_proc_id == o->phys_proc_id && 425 if (c->phys_proc_id == o->phys_proc_id &&
426 per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2) && 426 per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2)) {
427 c->cpu_core_id == o->cpu_core_id) 427 if (c->cpu_core_id == o->cpu_core_id)
428 return topology_sane(c, o, "smt"); 428 return topology_sane(c, o, "smt");
429
430 if ((c->cu_id != 0xff) &&
431 (o->cu_id != 0xff) &&
432 (c->cu_id == o->cu_id))
433 return topology_sane(c, o, "smt");
434 }
429 435
430 } else if (c->phys_proc_id == o->phys_proc_id && 436 } else if (c->phys_proc_id == o->phys_proc_id &&
431 c->cpu_core_id == o->cpu_core_id) { 437 c->cpu_core_id == o->cpu_core_id) {