aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSisir Koppaka <sisir.koppaka@gmail.com>2011-03-26 08:52:55 -0400
committerIngo Molnar <mingo@elte.hu>2011-03-31 07:00:37 -0400
commit3436ae1298cb22d722a6520fc97f112dd767a9e1 (patch)
treeba05a2b0a80157f9eb19e34b0ac54b9dd279600b /kernel
parente2495b577324938f0209b4f895c5f205c7e47854 (diff)
sched: Fix rebalance interval calculation
The interval for checking scheduling domains if they are due to be balanced currently depends on boot state NR_CPUS, which may not accurately reflect the number of online CPUs at the time of check. Thus replace NR_CPUS with num_online_cpus(). (ed: Should only affect those who set NR_CPUS really high, such as 4096 or so :-) Signed-off-by: Sisir Koppaka <sisir.koppaka@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <AANLkTikqHWid2Q93F5U5Qw5snJH8C5PXoa7J6=6hYO94@mail.gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched_fair.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 3f7ec9e27ee1..c7ec5c8e7b44 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -22,6 +22,7 @@
22 22
23#include <linux/latencytop.h> 23#include <linux/latencytop.h>
24#include <linux/sched.h> 24#include <linux/sched.h>
25#include <linux/cpumask.h>
25 26
26/* 27/*
27 * Targeted preemption latency for CPU-bound tasks: 28 * Targeted preemption latency for CPU-bound tasks:
@@ -3850,8 +3851,8 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
3850 interval = msecs_to_jiffies(interval); 3851 interval = msecs_to_jiffies(interval);
3851 if (unlikely(!interval)) 3852 if (unlikely(!interval))
3852 interval = 1; 3853 interval = 1;
3853 if (interval > HZ*NR_CPUS/10) 3854 if (interval > HZ*num_online_cpus()/10)
3854 interval = HZ*NR_CPUS/10; 3855 interval = HZ*num_online_cpus()/10;
3855 3856
3856 need_serialize = sd->flags & SD_SERIALIZE; 3857 need_serialize = sd->flags & SD_SERIALIZE;
3857 3858