Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2017-11-15 14:39:17 +0000
committerMel Gorman <mgorman@suse.de>2017-11-15 14:39:19 +0000
commit9d790c39b9c09670ca09a4354afb5db3c5075ba6 (patch)
tree9aeb2035c5c93e04804ec5fe66d488f383b7eb5f
parent16759479fe1326b11a3f7d7cddfda2de701bc812 (diff)
sched/idle: Micro-optimize the idle loop (bnc#978907 Scheduler
performance -- idle). suse-commit: 5b7585f991d3c11130157c84d7fd5b98e09d2040
-rw-r--r--kernel/sched/idle.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index ef63adce0c9c..44c3b46a57ca 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -209,6 +209,7 @@ exit_idle:
*/
static void do_idle(void)
{
+ int cpu = smp_processor_id();
/*
* If the arch has a polling bit, we maintain an invariant:
*
@@ -225,7 +226,7 @@ static void do_idle(void)
check_pgt_cache();
rmb();
- if (cpu_is_offline(smp_processor_id())) {
+ if (cpu_is_offline(cpu)) {
cpuhp_report_idle_dead();
arch_cpu_idle_dead();
}