diff options
author | Venkatesh Pallipadi <venki@google.com> | 2010-05-21 20:09:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-06-09 04:34:52 -0400 |
commit | 83cd4fe27ad8446619b2e030b171b858501de87d (patch) | |
tree | 81c7d26f4f00139ae355017239371d91cc4b2aef /kernel/timer.c | |
parent | fdf3e95d3916f18bf8703fb065499fdbc4dfe34c (diff) |
sched: Change nohz idle load balancing logic to push model
In the new push model, all idle CPUs indeed go into nohz mode. There is
still the concept of idle load balancer (performing the load balancing
on behalf of all the idle cpu's in the system). Busy CPU kicks the nohz
balancer when any of the nohz CPUs need idle load balancing.
The kickee CPU does the idle load balancing on behalf of all idle CPUs
instead of the normal idle balance.
This addresses the below two problems with the current nohz ilb logic:
* the idle load balancer continued to have periodic ticks during idle and
wokeup frequently, even though it did not have any rebalancing to do on
behalf of any of the idle CPUs.
* On x86 and CPUs that have APIC timer stoppage on idle CPUs, this
periodic wakeup can result in a periodic additional interrupt on a CPU
doing the timer broadcast.
Also currently we are migrating the unpinned timers from an idle to the cpu
doing idle load balancing (when all the cpus in the system are idle,
there is no idle load balancing cpu and timers get added to the same idle cpu
where the request was made. So the existing optimization works only on semi idle
system).
And In semi idle system, we no longer have periodic ticks on the idle load
balancer CPU. Using that cpu will add more delays to the timers than intended
(as that cpu's timer base may not be uptodate wrt jiffies etc). This was
causing mysterious slowdowns during boot etc.
For now, in the semi idle case, use the nearest busy cpu for migrating timers
from an idle cpu. This is good for power-savings anyway.
Signed-off-by: Venkatesh Pallipadi <venki@google.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <1274486981.2840.46.camel@sbs-t61.sc.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/timer.c')
-rw-r--r-- | kernel/timer.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index ee305c8d4e18..48d6aec0789c 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -679,12 +679,8 @@ __mod_timer(struct timer_list *timer, unsigned long expires, | |||
679 | cpu = smp_processor_id(); | 679 | cpu = smp_processor_id(); |
680 | 680 | ||
681 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) | 681 | #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) |
682 | if (!pinned && get_sysctl_timer_migration() && idle_cpu(cpu)) { | 682 | if (!pinned && get_sysctl_timer_migration() && idle_cpu(cpu)) |
683 | int preferred_cpu = get_nohz_load_balancer(); | 683 | cpu = get_nohz_timer_target(); |
684 | |||
685 | if (preferred_cpu >= 0) | ||
686 | cpu = preferred_cpu; | ||
687 | } | ||
688 | #endif | 684 | #endif |
689 | new_base = per_cpu(tvec_bases, cpu); | 685 | new_base = per_cpu(tvec_bases, cpu); |
690 | 686 | ||