From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 13/32] wait: Add wait_event_hrtimeout() Date: Thu, 3 Jan 2013 15:08:16 -0800 Message-ID: <20130103150816.f0dda169.akpm@linux-foundation.org> References: <1356573611-18590-1-git-send-email-koverstreet@google.com> <1356573611-18590-15-git-send-email-koverstreet@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, zab@redhat.com, bcrl@kvack.org, jmoyer@redhat.com, axboe@kernel.dk, viro@zeniv.linux.org.uk, tytso@mit.edu To: Kent Overstreet Return-path: In-Reply-To: <1356573611-18590-15-git-send-email-koverstreet@google.com> Sender: owner-linux-aio@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Wed, 26 Dec 2012 17:59:51 -0800 Kent Overstreet wrote: > Analagous to wait_event_timeout() and friends, this adds > wait_event_hrtimeout() and wait_event_interruptible_hrtimeout(). > > Note that unlike the versions that use regular timers, these don't > return the amount of time remaining when they return - instead, they > return 0 or -ETIME if they timed out. Why is this? > +/** > + * wait_event_hrtimeout - sleep until a condition gets true or a timeout elapses > + * @wq: the waitqueue to wait on > + * @condition: a C expression for the event to wait for > + * @timeout: timeout, in jiffies > + * > + * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the > + * @condition evaluates to true or a signal is received. > + * The @condition is checked each time the waitqueue @wq is woken up. > + * > + * wake_up() has to be called after changing any variable that could > + * change the result of the wait condition. > + * > + * The function returns 0 if @condition became true, or -ETIME if the timeout > + * elapsed. > + */ this, methinks: --- a/include/linux/wait.h~wait-add-wait_event_hrtimeout-fix +++ a/include/linux/wait.h @@ -370,7 +370,7 @@ do { \ * wait_event_hrtimeout - sleep until a condition gets true or a timeout elapses * @wq: the waitqueue to wait on * @condition: a C expression for the event to wait for - * @timeout: timeout, in jiffies + * @timeout: timeout, as a ktime_t * * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the * @condition evaluates to true or a signal is received. @@ -395,7 +395,7 @@ do { \ * wait_event_interruptible_hrtimeout - sleep until a condition gets true or a timeout elapses * @wq: the waitqueue to wait on * @condition: a C expression for the event to wait for - * @timeout: timeout, in jiffies + * @timeout: timeout, as a ktime_t * * The process is put to sleep (TASK_INTERRUPTIBLE) until the * @condition evaluates to true or a signal is received. _ -- To unsubscribe, send a message with 'unsubscribe linux-aio' in the body to majordomo@kvack.org. For more info on Linux AIO, see: http://www.kvack.org/aio/ Don't email: aart@kvack.org