]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - arch/x86/kernel/smpboot.c
x86/topology: Add topology_max_smt_threads()
authorAndi Kleen <ak@linux.intel.com>
Fri, 20 May 2016 00:09:55 +0000 (17:09 -0700)
committerIngo Molnar <mingo@kernel.org>
Fri, 3 Jun 2016 07:41:21 +0000 (09:41 +0200)
commit70b8301f6b8f7bc053377a9cbd0c4e42e29d9807
treed29e04218ccc32b9e7da313c398a86a4c3b52c50
parentdc89e75a9412db5b1105a140182ec1e35a8351b4
x86/topology: Add topology_max_smt_threads()

For SMT specific workarounds it is useful to know if SMT is active
on any online CPU in the system. This currently requires a loop
over all online CPUs.

Add a global variable that is updated with the maximum number
of smt threads on any CPU on online/offline, and use it for
topology_max_smt_threads()

The single call is easier to use than a loop.

Not exported to user space because user space already can use
the existing sibling interfaces to find this out.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: acme@kernel.org
Cc: jolsa@kernel.org
Link: http://lkml.kernel.org/r/1463703002-19686-2-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/topology.h
arch/x86/kernel/smpboot.c