From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: poll: allow f_op->poll to sleep, take #3 Date: Sun, 23 Nov 2008 18:43:12 +0900 Message-ID: <492925B0.9030404@gmail.com> References: <20081122123942.GF5707@parisc-linux.org> <4927FE87.6050005@gmail.com> <20081122105356.87856d04.akpm@linux-foundation.org> <4928B162.9030404@gmail.com> <20081123085902.GI30453@elte.hu> <49291F06.5040907@gmail.com> <20081123093420.GN30453@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Davide Libenzi , Andrew Morton , Matthew Wilcox , Miklos Szeredi , arjan@linux.intel.com, Linus Torvalds , hch@infradead.org, rminnich@sandia.gov, ericvh@gmail.com, Linux Kernel Mailing List , linux-fsdevel@vger.kernel.org To: Ingo Molnar Return-path: Received: from ag-out-0708.google.com ([72.14.246.247]:52864 "EHLO ag-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751496AbYKWJnT (ORCPT ); Sun, 23 Nov 2008 04:43:19 -0500 Received: by ag-out-0708.google.com with SMTP id 31so1155471agc.10 for ; Sun, 23 Nov 2008 01:43:18 -0800 (PST) In-Reply-To: <20081123093420.GN30453@elte.hu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Ingo Molnar wrote: > _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. It's not really about what I want but more about how the interface looks in the first place. Something like the following is simply ugly. int my_callback(param a, param b, param c) { WARN_ON(b != B); do_something(a); } And @sync might be useful depending on who's waking it up, so we either need to change the wake interface or give it an easier way to pass those parameters as received. The callback function isn't the right place to ignore those parameters. It simply doesn't know why the caller is passing them in or what they mean under the circumstances. Thanks. -- tejun