Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118767
b: refs/heads/master
c: ad474ca
h: refs/heads/master
i:
  118765: 422f00e
  118763: 0cd7c57
  118759: 742c56a
  118751: c19cbac
v: v3
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Nov 11, 2008
1 parent 24a4287 commit 9446297
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5ac5c4d604bf894ef672a7971d03fefdc7ea7e49
refs/heads/master: ad474caca3e2a0550b7ce0706527ad5ab389a4d4
1 change: 1 addition & 0 deletions trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ extern void init_idle(struct task_struct *idle, int cpu);
extern void init_idle_bootup_task(struct task_struct *idle);

extern int runqueue_is_locked(void);
extern void task_rq_unlock_wait(struct task_struct *p);

extern cpumask_t nohz_cpu_mask;
#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
Expand Down
5 changes: 5 additions & 0 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ static void __exit_signal(struct task_struct *tsk)
if (sig) {
flush_sigqueue(&sig->shared_pending);
taskstats_tgid_free(sig);
/*
* Make sure ->signal can't go away under rq->lock,
* see account_group_exec_runtime().
*/
task_rq_unlock_wait(tsk);
__cleanup_signal(sig);
}
}
Expand Down
8 changes: 8 additions & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,14 @@ static struct rq *task_rq_lock(struct task_struct *p, unsigned long *flags)
}
}

void task_rq_unlock_wait(struct task_struct *p)
{
struct rq *rq = task_rq(p);

smp_mb(); /* spin-unlock-wait is not a full memory barrier */
spin_unlock_wait(&rq->lock);
}

static void __task_rq_unlock(struct rq *rq)
__releases(rq->lock)
{
Expand Down

0 comments on commit 9446297

Please sign in to comment.