lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081123093420.GN30453@elte.hu>
Date:	Sun, 23 Nov 2008 10:34:20 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Tejun Heo <htejun@...il.com>
Cc:	Davide Libenzi <davidel@...ilserver.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Matthew Wilcox <matthew@....cx>,
	Miklos Szeredi <miklos@...redi.hu>, arjan@...ux.intel.com,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	hch@...radead.org, rminnich@...dia.gov, ericvh@...il.com,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-fsdevel@...r.kernel.org
Subject: Re: poll: allow f_op->poll to sleep, take #3


* Tejun Heo <htejun@...il.com> wrote:

> Ingo Molnar wrote:
> > * Davide Libenzi <davidel@...ilserver.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.
> 
> Well, the problem is that for wait wake up functions @mode and @sync 
> are passed as parameter and should be passed over to actual wake up 
> function as-is, if I add @mode and @sync to wake_up_process() family 
> of APIs, it's just try_to_wake_up().

_sync() is not something that should normally be done from poll 
handlers. But ->poll() handlers should all be TASK_INTERRUPTIBLE, 
right? So wake_up_process_interruptible() should be the thing you 
need?

Anyway, if you really want to pass in a state filter, you can use the 
already existing wake_up_state() method as well.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ