aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/semaphore.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2011-10-17 11:50:30 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-25 07:10:14 +0200
commit607ce3ed1cf6aa5af82a12faf1adf0de5d2f583e (patch)
treec362e60a92b358b460147092ea479bb3f52055c8 /kernel/semaphore.c
parentf62f4cad504f32e9d4e407ea5ba8a743da399a8a (diff)
downloadkernel_samsung_aries-607ce3ed1cf6aa5af82a12faf1adf0de5d2f583e.zip
kernel_samsung_aries-607ce3ed1cf6aa5af82a12faf1adf0de5d2f583e.tar.gz
kernel_samsung_aries-607ce3ed1cf6aa5af82a12faf1adf0de5d2f583e.tar.bz2
cputimer: Cure lock inversion
commit bcd5cff7216f9b2de0a148cc355eac199dc6f1cf upstream. There's a lock inversion between the cputimer->lock and rq->lock; notably the two callchains involved are: update_rlimit_cpu() sighand->siglock set_process_cpu_timer() cpu_timer_sample_group() thread_group_cputimer() cputimer->lock thread_group_cputime() task_sched_runtime() ->pi_lock rq->lock scheduler_tick() rq->lock task_tick_fair() update_curr() account_group_exec() cputimer->lock Where the first one is enabling a CLOCK_PROCESS_CPUTIME_ID timer, and the second one is keeping up-to-date. This problem was introduced by e8abccb7193 ("posix-cpu-timers: Cure SMP accounting oddities"). Cure the problem by removing the cputimer->lock and rq->lock nesting, this leaves concurrent enablers doing duplicate work, but the time wasted should be on the same order otherwise wasted spinning on the lock and the greater-than assignment filter should ensure we preserve monotonicity. Reported-by: Dave Jones <davej@redhat.com> Reported-by: Simon Kirby <sim@hostway.ca> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Link: http://lkml.kernel.org/r/1318928713.21167.4.camel@twins Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/semaphore.c')
0 files changed, 0 insertions, 0 deletions