Messages in this thread | | | Date | Tue, 5 Aug 2014 16:29:16 -0700 | From | Greg Kroah-Hartman <> | Subject | Re: [RFC][PATCH 5/7] tty: Deal with nested sleeps |
| |
On Mon, Aug 04, 2014 at 12:30:30PM +0200, Peter Zijlstra wrote: > 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 and the wait loop breaks the sleep functions that assume > TASK_RUNNING (mutex_lock). > > 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. > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Jiri Slaby <jslaby@suse.cz> > Signed-off-by: Peter Zijlstra <peterz@infradead.org> > --- > drivers/tty/n_tty.c | 17 +++++------------ > 1 file changed, 5 insertions(+), 12 deletions(-) >
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| |