lkml.org 
[lkml]   [2014]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/11] module: Fix nested sleep
On Tue, Sep 30, 2014 at 12:18:23AM +0200, Oleg Nesterov wrote:
> On 09/24, Peter Zijlstra wrote:
> >
> > A genuine bug, we cannot use blocking primitives inside a wait loop.
> >
> > So rewrite the wait_event_interruptible() usage to use the fresh
> > wait_woken() stuff.
>
> OK, but ...
>
> > +static int wait_finished_loading(struct module *mod)
> > +{
> > + DEFINE_WAIT_FUNC(wait, woken_wake_function);
> > + int ret = 0;
> > +
> > + add_wait_queue(&module_wq, &wait);
> > + for (;;) {
> > + if (finished_loading(mod->name))
> > + break;
> > +
> > + if (signal_pending_state(TASK_INTERRUPTIBLE, current)) {
>
> I am puzzled by this line, why not
>
> if (signal_pending(current)) {
>
> ?
>
> this should be 100% equivalent.

Ah, because I looked at ___wait_event() and that ends up using
signal_pending_state() through preprare_to_wait_event().

I did not actually 'think' much. Lemme change that for you.


\
 
 \ /
  Last update: 2014-09-30 16:01    [W:0.103 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site