scheduler fixes
Subsystems (3)
Linus,
Please pull the latest sched-fixes-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched-fixes-for-linus
It's a bit larger than usual - partly because it accumulated over two weeks and partly because two complex fixes arrived late which needed more testing.
Thanks,
Ingo
------------------>
Heiko Carstens (1):
nohz: Fix get_next_timer_interrupt() vs cpu hotplug
Mike Galbraith (1):
Sched: fix skip_clock_update optimization
Peter Zijlstra (3):
sched: Cure more NO_HZ load average woes
sched: Fix the irqtime code to deal with u64 wraps
sched: Fix the irqtime code for 32bit
include/linux/sched.h | 2 +- kernel/fork.c | 1 + kernel/sched.c | 288 ++++++++++++++++++++++++++++++++++++++++--------- kernel/timer.c | 8 ++- 4 files changed, 246 insertions(+), 53 deletions(-)
include/linux/sched.h +1 -1
@@ -143,7 +143,7 @@ extern unsigned long nr_iowait_cpu(int cpu);extern unsigned long this_cpu_load (void ); -extern void calc_global_load (void ); +extern void calc_global_load (unsigned long ticks);extern unsigned long get_parent_ip (unsigned long addr);
kernel/fork.c +1 -0
@@ -273,6 +273,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)setup_thread_stack (tsk, orig);clear_user_return_notifier (tsk); +clear_tsk_need_resched (tsk); stackend =end_of_stack (tsk); *stackend =STACK_END_MAGIC ;/* for overflow detection */
kernel/sched.c +237 -51
405 lines not on this page · raw message
kernel/timer.c +7 -1
@@ -1252,6 +1252,12 @@ unsigned long get_next_timer_interrupt(unsigned long now)struct tvec_base *base =__get_cpu_var (tvec_bases);unsigned long expires; +/* +* Pretend that there is no timer pending if the cpu is offline. +* Possible pending timers will be migrated later to an active cpu. +*/ +if (cpu_is_offline (smp_processor_id ())) +return now +NEXT_TIMER_MAX_DELTA ;spin_lock (&base->lock);if (time_before_eq (base->next_timer, base->timer_jiffies)) base->next_timer =__next_timer_interrupt (base);
@@ -1319,7 +1325,7 @@ void do_timer(unsigned long ticks) { jiffies_64 += ticks;update_wall_time (); -calc_global_load (); +calc_global_load (ticks); }#ifdef __ARCH_WANT_SYS_ALARM
kern
Quoted 9 lines · Ingo Molnar
kernel/sched.c +1
-0@@ -3943,6 +4128,7 @@ need_resched_nonpreemptible: rq->nr_switches++; rq->curr = next; ++*switch_count; + WARN_ON_ONCE(test_tsk_need_resched(next));context_switch(rq, prev, next); /* unlocks the rq */ /*
kern renamed from kernel/timer.c +0
-0
Please don't add like this in an -rc. It looks like it's some debugging aid, I don't think it should have gone in now.
And yes, it triggers for me.
Linus
[ 1321.625764] ------------[ cut here ]------------ [ 1321.625773] WARNING: at kernel/sched.c:4131 schedule+0x5d1/0x978() [ 1321.625774] Hardware name: System Product Name [ 1321.625776] Modules linked in: [last unloaded: scsi_wait_scan] [ 1321.625779] Pid: 3630, comm: chrome Not tainted 2.6.37-rc6-00132-g55ec86f #56 [ 1321.625781] Call Trace: [ 1321.625787] [<ffffffff810385c5>] warn_slowpath_common+0x80/0x98 [ 1321.625790] [<ffffffff810385f2>] warn_slowpath_null+0x15/0x17 [ 1321.625792] [<ffffffff8153b2ed>] schedule+0x5d1/0x978 [ 1321.625795] [<ffffffff810324d0>] ? sub_preempt_count+0x92/0xa5 [ 1321.625798] [<ffffffff8153e0aa>] ? _raw_spin_unlock_irqrestore+0x46/0x64 [ 1321.625802] [<ffffffff810536fe>] ? __hrtimer_start_range_ns+0x328/0x33a [ 1321.625805] [<ffffffff8153cb6c>] schedule_hrtimeout_range_clock+0xc8/0xfa [ 1321.625808] [<ffffffff81052f0a>] ? hrtimer_wakeup+0x0/0x21 [ 1321.625810] [<ffffffff81050497>] ? add_wait_queue+0x3f/0x44 [ 1321.625812] [<ffffffff8153cbac>] schedule_hrtimeout_range+0xe/0x10 [ 1321.625816] [<ffffffff810cc3b0>] poll_schedule_timeout+0x43/0x5f [ 1321.625818] [<ffffffff810cd65f>] do_sys_poll+0x351/0x3e8 [ 1321.625820] [<ffffffff810cc45b>] ? __pollwait+0x0/0xc7 [ 1321.625822] [<ffffffff810cc522>] ? pollwake+0x0/0x4f [ 1321.625824] [<ffffffff810cc522>] ? pollwake+0x0/0x4f [ 1321.625827] [<ffffffff810cc522>] ? pollwake+0x0/0x4f [ 1321.625829] [<ffffffff8103240e>] ? get_parent_ip+0x11/0x41 [ 1321.625832] [<ffffffff811e7000>] ? sys_semtimedop+0x8bc/0x972 [ 1321.625834] [<ffffffff811e704c>] ? sys_semtimedop+0x908/0x972 [ 1321.625838] [<ffffffff81462299>] ? sock_aio_read+0x123/0x13b [ 1321.625842] [<ffffffff8103d001>] ? timespec_add_safe+0x32/0x61 [ 1321.625844] [<ffffffff810cc6c2>] ? poll_select_set_timeout+0x61/0x75 [ 1321.625847] [<ffffffff810cd793>] sys_poll+0x50/0xba [ 1321.625851] [<ffffffff81001ffb>] system_call_fastpath+0x16/0x1b [ 1321.625853] ---[ end trace 3ba46a028c3b4324 ]---
Quoted 7 lines · Linus Torvalds
Quoted 6 lines · Ingo Molnar
(quoted diff) +1
-0@@ -3943,6 +4128,7 @@ need_resched_nonpreemptible: rq->nr_switches++; rq->curr = next; ++*switch_count; + WARN_ON_ONCE(test_tsk_need_resched(next));
Quoted 6 lines
kern
Quoted 3 lines
context_switch(rq, prev, next); /* unlocks the rq */ /*
kern renamed from kernel/timer.c +0
-0Please don't add like this in an -rc. It looks like it's some debugging aid, I don't think it should have gone in now.
Yeah - sorry about that. The warning is bogus - please pull the updated tree below. (Can also be pulled on top of the previous one.)
Thanks,
Ingo
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched-fixes-for-linus
------------------>
Heiko Carstens (1):
nohz: Fix get_next_timer_interrupt() vs cpu hotplug
Ingo Molnar (1):
sched: Remove debugging check
Mike Galbraith (1):
Sched: fix skip_clock_update optimization
Peter Zijlstra (3):
sched: Cure more NO_HZ load average woes
sched: Fix the irqtime code to deal with u64 wraps
sched: Fix the irqtime code for 32bit
include/linux/sched.h | 2 +- kernel/fork.c | 1 + kernel/sched.c | 287 ++++++++++++++++++++++++++++++++++++++++--------- kernel/timer.c | 8 ++- 4 files changed, 245 insertions(+), 53 deletions(-)
include/linux/sched.h +1 -1
@@ -143,7 +143,7 @@ extern unsigned long nr_iowait_cpu(int cpu);extern unsigned long this_cpu_load (void ); -extern void calc_global_load (void ); +extern void calc_global_load (unsigned long ticks);extern unsigned long get_parent_ip (unsigned long addr);
kernel/fork.c +1 -0
@@ -273,6 +273,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig)setup_thread_stack (tsk, orig);clear_user_return_notifier (tsk); +clear_tsk_need_resched (tsk); stackend =end_of_stack (tsk); *stackend =STACK_END_MAGIC ;/* for overflow detection */
kernel/sched.c +236 -51
398 lines not on this page · raw message
kernel/timer.c +7 -1
@@ -1252,6 +1252,12 @@ unsigned long get_next_timer_interrupt(unsigned long now)struct tvec_base *base =__get_cpu_var (tvec_bases);unsigned long expires; +/* +* Pretend that there is no timer pending if the cpu is offline. +* Possible pending timers will be migrated later to an active cpu. +*/ +if (cpu_is_offline (smp_processor_id ())) +return now +NEXT_TIMER_MAX_DELTA ;spin_lock (&base->lock);if (time_before_eq (base->next_timer, base->timer_jiffies)) base->next_timer =__next_timer_interrupt (base);
@@ -1319,7 +1325,7 @@ void do_timer(unsigned long ticks) { jiffies_64 += ticks;update_wall_time (); -calc_global_load (); +calc_global_load (ticks); }#ifdef __ARCH_WANT_SYS_ALARM
[tip:sched/urgent] sched: Remove debugging check
In reply to Linus TorvaldsCommit-ID: 050c6c9b896625d9fa498265be17b82c5fc65257 Gitweb: http://git.kernel.org/tip/050c6c9b896625d9fa498265be17b82c5fc65257 Author: Ingo Molnar <[email protected]> AuthorDate: Sun, 19 Dec 2010 23:24:27 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Sun, 19 Dec 2010 23:24:27 +0100
sched: Remove debugging check
Linus reported that the new warning introduced by commit f26f9aff6aaf "Sched: fix skip_clock_update optimization" triggers. The need_resched flag can be set by other CPUs asynchronously so this debug check is bogus - remove it.
LKML-Reference: <[email protected]>
--- kernel/sched.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
kernel/sched.c +0 -1
@@ -4128,7 +4128,6 @@ need_resched_nonpreemptible: rq->nr_switches++; rq->curr = next; ++*switch_count; -WARN_ON_ONCE (test_tsk_need_resched (next));context_switch (rq, prev, next);/* unlocks the rq */ /*
Quoted 7 lines · Linus Torvalds
Quoted 6 lines · Ingo Molnar
kernel/sched.c +1
-0@@ -3943,6 +4128,7 @@ need_resched_nonpreemptible: rq->nr_switches++; rq->curr = next; ++*switch_count; +WARN_ON_ONCE (test_tsk_need_resched (next));
Quoted 7 lines
kern
Quoted 3 lines
kernel/sched.c +0
-0context_switch (rq, prev, next);/* unlocks the rq */ /* kern renamed from kernel/timer.c +0
-0Please don't add like this in an -rc. It looks like it's some debugging aid, I don't think it should have gone in now.
Correct, I did ask Ingo to remove that line before he pushed it out to you. Anyway, it seems to be sorted now. Sorry for the bother.