sched/wait: Provide infrastructure to deal with nested blocking
authorPeter Zijlstra <peterz@infradead.org>
Wed, 24 Sep 2014 08:18:47 +0000 (10:18 +0200)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 17 Apr 2015 00:11:19 +0000 (20:11 -0400)
commit32384effc14fcd45beacae7a586658b7af7c67e3
tree7354b13c972c39bcc0af3d3bf924d329767e17d5
parent2e7822fa339137f9db66d591cf099fa3525a8e5f
sched/wait: Provide infrastructure to deal with nested blocking

[ Upstream commit 61ada528dea028331e99e8ceaed87c683ad25de2 ]

There are a few places that call blocking primitives from wait loops,
provide infrastructure to support this without the typical
task_struct::state collision.

We record the wakeup in wait_queue_t::flags which leaves
task_struct::state free to be used by others.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: tglx@linutronix.de
Cc: ilya.dryomov@inktank.com
Cc: umgwanakikbuti@gmail.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20140924082242.051202318@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
include/linux/wait.h
kernel/sched/wait.c