sched: Add sched_smt_active()
authorBen Hutchings <ben@decadent.org.uk>
Thu, 9 May 2019 23:46:25 +0000 (00:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 May 2019 17:19:36 +0000 (19:19 +0200)
commitc803409910a6e2ca70c3edd557aeda0055827f7a
treeac5342d9eacd889f9665638ace57e9ba44c2a08e
parent4cc154901e47d56e7491d37f7a81768ddb96e733
sched: Add sched_smt_active()

Add the sched_smt_active() function needed for some x86 speculation
mitigations.  This was introduced upstream by commits 1b568f0aabf2
"sched/core: Optimize SCHED_SMT", ba2591a5993e "sched/smt: Update
sched_smt_present at runtime", c5511d03ec09 "sched/smt: Make
sched_smt_present track topology", and 321a874a7ef8 "sched/smt: Expose
sched_smt_present static key".  The upstream implementation uses the
static_key_{disable,enable}_cpuslocked() functions, which aren't
practical to backport.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/sched/smt.h [new file with mode: 0644]
kernel/sched/core.c
kernel/sched/sched.h