diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-07-20 20:59:26 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-07-20 20:59:26 +0200 |
commit | d1e9ae47a0285d3f1699e8219ce50f656243b93f (patch) | |
tree | 2f5a68b5ba1677bcd49ee759f09ffc5ccccb1455 /kernel/sched.c | |
parent | e6625fa48e6580a74b7e700efd7e6463e282810b (diff) | |
parent | a841796f11c90d53dbac773be56b04fbee8af272 (diff) | |
download | kernel_samsung_tuna-d1e9ae47a0285d3f1699e8219ce50f656243b93f.zip kernel_samsung_tuna-d1e9ae47a0285d3f1699e8219ce50f656243b93f.tar.gz kernel_samsung_tuna-d1e9ae47a0285d3f1699e8219ce50f656243b93f.tar.bz2 |
Merge branch 'rcu/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-2.6-rcu into core/urgent
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 3dc716f..31e92ae 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2544,13 +2544,9 @@ static int ttwu_remote(struct task_struct *p, int wake_flags) } #ifdef CONFIG_SMP -static void sched_ttwu_pending(void) +static void sched_ttwu_do_pending(struct task_struct *list) { struct rq *rq = this_rq(); - struct task_struct *list = xchg(&rq->wake_list, NULL); - - if (!list) - return; raw_spin_lock(&rq->lock); @@ -2563,9 +2559,45 @@ static void sched_ttwu_pending(void) raw_spin_unlock(&rq->lock); } +#ifdef CONFIG_HOTPLUG_CPU + +static void sched_ttwu_pending(void) +{ + struct rq *rq = this_rq(); + struct task_struct *list = xchg(&rq->wake_list, NULL); + + if (!list) + return; + + sched_ttwu_do_pending(list); +} + +#endif /* CONFIG_HOTPLUG_CPU */ + void scheduler_ipi(void) { - sched_ttwu_pending(); + struct rq *rq = this_rq(); + struct task_struct *list = xchg(&rq->wake_list, NULL); + + if (!list) + return; + + /* + * Not all reschedule IPI handlers call irq_enter/irq_exit, since + * traditionally all their work was done from the interrupt return + * path. Now that we actually do some work, we need to make sure + * we do call them. + * + * Some archs already do call them, luckily irq_enter/exit nest + * properly. + * + * Arguably we should visit all archs and update all handlers, + * however a fair share of IPIs are still resched only so this would + * somewhat pessimize the simple resched case. + */ + irq_enter(); + sched_ttwu_do_pending(list); + irq_exit(); } static void ttwu_queue_remote(struct task_struct *p, int cpu) |