sched, tty: Deal with nested sleeps
authorPeter Zijlstra <peterz@infradead.org>
Wed, 24 Sep 2014 08:18:51 +0000 (10:18 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 28 Oct 2014 09:56:10 +0000 (10:56 +0100)
commit97d9e28d1a27b84a6a0b155f2390289afa279341
tree795f01ef74c97cb2397f0abddb17234c0b264b75
parente23738a7300a7591a57a22f47b813fd1b53ec404
sched, tty: Deal with nested sleeps

n_tty_{read,write} are wait loops with sleeps in. Wait loops rely on
task_struct::state and sleeps do too, since that's the only means of
actually sleeping. Therefore the nested sleeps destroy the wait loop
state.

Fix this by using the new woken_wake_function and wait_woken() stuff,
which registers wakeups in wait and thereby allows shrinking the
task_state::state changes to the actual sleep part.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: tglx@linutronix.de
Cc: ilya.dryomov@inktank.com
Cc: umgwanakikbuti@gmail.com
Cc: oleg@redhat.com
Link: http://lkml.kernel.org/r/20140924082242.323011233@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/tty/n_tty.c