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: <20130402014353.GB30122@thunk.org>
Date:	Mon, 1 Apr 2013 21:43:53 -0400
From:	Theodore Ts'o <tytso@....edu>
To:	Kent Overstreet <koverstreet@...gle.com>
Cc:	linux-kernel@...r.kernel.org, linux-aio@...ck.org,
	akpm@...ux-foundation.org, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...e.hu>, Zach Brown <zab@...hat.com>,
	Felipe Balbi <balbi@...com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Mark Fasheh <mfasheh@...e.com>,
	Joel Becker <jlbec@...lplan.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Jens Axboe <axboe@...nel.dk>,
	Asai Thambi S P <asamymuthupa@...ron.com>,
	Selvan Mani <smani@...ron.com>,
	Sam Bradshaw <sbradshaw@...ron.com>,
	Jeff Moyer <jmoyer@...hat.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Benjamin LaHaise <bcrl@...ck.org>
Subject: Re: [PATCH 13/33] wait: add wait_event_hrtimeout()

On Thu, Mar 21, 2013 at 09:35:34AM -0700, 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.  because I was uncomfortable with the semantics
> of doing it the other way (that I could get it right, anyways).
> 
> If the timer expires, there's no real guarantee that expire_time -
> current_time would be <= 0 - due to timer slack certainly, and I'm not
> sure I want to know the implications of the different clock bases in
> hrtimers.
> 
> If the timer does expire and the code calculates that the time remaining
> is nonnegative, that could be even worse if the calling code then reuses
> that timeout.  Probably safer to just return 0 then, but I could imagine
> weird bugs or at least unintended behaviour arising from that too.
> 
> I came to the conclusion that if other users end up actually needing the
> amount of time remaining, the sanest thing to do would be to create a
> version that uses absolute timeouts instead of relative.

Reviewed-by: "Theodore Ts'o" <tytso@....edu>

--
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