Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255022
b: refs/heads/master
c: c5d753a
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Paul E. McKenney committed Jul 20, 2011
1 parent 401eb0b commit 57c0d65
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 10f39bb1b2c1923ca73e70cb13aeee0e9b822d8f
refs/heads/master: c5d753a55ac92e09816d410cd17093813f1a904b
44 changes: 38 additions & 6 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)
Expand Down

0 comments on commit 57c0d65

Please sign in to comment.