lkml.org 
[lkml]   [2008]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: poll: allow f_op->poll to sleep, take #3

* Davide Libenzi <davidel@xmailserver.org> wrote:

> On Sun, 23 Nov 2008, Tejun Heo wrote:
>
> > +static int pollwake(wait_queue_t *wait, unsigned mode, int sync, void *key)
> > +{
> > + struct poll_wqueues *pwq = wait->private;
> > + DECLARE_WAITQUEUE(dummy_wait, pwq->polling_task);
> > +
> > + set_mb(pwq->triggered, 1);
> > +
> > + /* perform the default wake up operation */
> > + return default_wake_function(&dummy_wait, mode, sync, key);
> > +}
>
> Wouldn't it be nicer to un-static try_to_wake_up() (or a wrapper)
> instead of setting up a fake wait queue just to use
> default_wake_function(), just to wake up a task?

the already existing single-task-wakeup shortcut method made available
by the scheduler is wake_up_process(). A number of primitives where
waitqueue overhead is of concern already make use of it.
(mutexes/rtmutexes and more)

if you need a different mode flag, then please extend the
wake_up_process() family of APIs.

Ingo


\
 
 \ /
  Last update: 2008-11-23 10:01    [from the cache]
©2003-2011 Jasper Spaans