diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 5 | ||||
-rw-r--r-- | kernel/sched.c | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 80137a5d9467..ae2b92be5fae 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -141,6 +141,11 @@ static void __exit_signal(struct task_struct *tsk) | |||
141 | if (sig) { | 141 | if (sig) { |
142 | flush_sigqueue(&sig->shared_pending); | 142 | flush_sigqueue(&sig->shared_pending); |
143 | taskstats_tgid_free(sig); | 143 | taskstats_tgid_free(sig); |
144 | /* | ||
145 | * Make sure ->signal can't go away under rq->lock, | ||
146 | * see account_group_exec_runtime(). | ||
147 | */ | ||
148 | task_rq_unlock_wait(tsk); | ||
144 | __cleanup_signal(sig); | 149 | __cleanup_signal(sig); |
145 | } | 150 | } |
146 | } | 151 | } |
diff --git a/kernel/sched.c b/kernel/sched.c index f3149244e324..50a21f964679 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -969,6 +969,14 @@ static struct rq *task_rq_lock(struct task_struct *p, unsigned long *flags) | |||
969 | } | 969 | } |
970 | } | 970 | } |
971 | 971 | ||
972 | void task_rq_unlock_wait(struct task_struct *p) | ||
973 | { | ||
974 | struct rq *rq = task_rq(p); | ||
975 | |||
976 | smp_mb(); /* spin-unlock-wait is not a full memory barrier */ | ||
977 | spin_unlock_wait(&rq->lock); | ||
978 | } | ||
979 | |||
972 | static void __task_rq_unlock(struct rq *rq) | 980 | static void __task_rq_unlock(struct rq *rq) |
973 | __releases(rq->lock) | 981 | __releases(rq->lock) |
974 | { | 982 | { |