lkml.org 
[lkml]   [2007]   [May]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: kernel/relay.c: a strange usage of delayed_work
FromTom Zanussi <>
DateFri, 04 May 2007 00:42:30 -0500
On Fri, 2007-05-04 at 01:38 +0400, Oleg Nesterov wrote:
> relay_switch_subbuf() does schedule_delayed_work(&buf->wake_readers, 1),
> wakeup_readers() only does wake_up_interruptible() and nothing more.
> 
> Why can't we use a plain timer for this?
> 
> In any case, this "wake_up ->read_wait after a minimal possible delay"
> looks somewhat strange to me, could you explain? just curious.
> 

The reason it's done that way is that if the event that causes the
relay_switch_subbuf() happens to be an event logged from schedule(), and
we directly call wake_up_interruptible() at that point, we lock up the
machine because it ends up back in schedule().  Deferring it avoids the
problem.

I don't see any problem with using a plain timer instead - I'll work up
a patch to make that change.

Tom



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-04 05:51    [from the cache]
©2003-2008