hi Mike, * Mike Kravetz <kravetz@us.ibm.com> wrote:I believe you are right - nice catch of this very nontrivial bug! The patch below is against .23-rc - do you think this fix (of moving the rt wakeup sequence to after the activate_task()) is adequate? Ingo Index: linux-rt-rebase.q/kernel/sched.c =================================================================== --- linux-rt-rebase.q.orig/kernel/sched.c +++ linux-rt-rebase.q/kernel/sched.c @@ -1819,6 +1819,13 @@ out_set_cpu: cpu = task_cpu(p); } +out_activate: +#endif /* CONFIG_SMP */ + + activate_task(rq, p, 1); + + trace_start_sched_wakeup(p, rq); + /* * If a newly woken up RT task cannot preempt the * current (RT) task (on a target runqueue) then try @@ -1849,28 +1856,21 @@ out_set_cpu: smp_send_reschedule_allbutself_cpumask(p->cpus_allowed); schedstat_inc(this_rq, rto_wakeup); - } - -out_activate: -#endif /* CONFIG_SMP */ - - activate_task(rq, p, 1); - - trace_start_sched_wakeup(p, rq); - - /* - * Sync wakeups (i.e. those types of wakeups where the waker - * has indicated that it will leave the CPU in short order) - * don't trigger a preemption, if the woken up task will run on - * this cpu. (in this case the 'I will reschedule' promise of - * the waker guarantees that the freshly woken up task is going - * to be considered on this CPU.) - */ - if (!sync || cpu != this_cpu) - check_preempt_curr(rq, p); - else { - if (TASK_PREEMPTS_CURR(p, rq)) - set_tsk_need_resched_delayed(rq->curr); + } else { + /* + * Sync wakeups (i.e. those types of wakeups where the waker + * has indicated that it will leave the CPU in short order) + * don't trigger a preemption, if the woken up task will run on + * this cpu. (in this case the 'I will reschedule' promise of + * the waker guarantees that the freshly woken up task is going + * to be considered on this CPU.) + */ + if (!sync || cpu != this_cpu) + check_preempt_curr(rq, p); + else { + if (TASK_PREEMPTS_CURR(p, rq)) + set_tsk_need_resched_delayed(rq->curr); + } } if (rq->curr && p && rq && _need_resched()) trace_special_pid(p->pid, PRIO(p), PRIO(rq->curr)); -
| Mariusz Kozlowski | [PATCH 01] kmalloc + memset conversion co kzalloc |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Jeremy Allison | Re: [RFC] Heads up on sys_fallocate() |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| David Miller | Re: [GIT]: Networking |
| Jeff Garzik | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
