From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751863AbcFWNmm (ORCPT ); Thu, 23 Jun 2016 09:42:42 -0400 Received: from www.linutronix.de ([62.245.132.108]:47889 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750885AbcFWNml (ORCPT ); Thu, 23 Jun 2016 09:42:41 -0400 Date: Thu, 23 Jun 2016 15:40:36 +0200 (CEST) From: Thomas Gleixner To: "Michael Kerrisk (man-pages)" cc: Darren Hart , Matthieu CASTET , linux-kernel@vger.kernel.org, Darren Hart , Peter Zijlstra , Davidlohr Bueso , Eric Dumazet Subject: Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op In-Reply-To: <520d203a-83ad-0277-79d5-2209d6853628@gmail.com> Message-ID: References: <20160620162652.2c4619c3@perruche.parrot.biz> <20160623044828.GA3379@f23x64.localdomain> <520d203a-83ad-0277-79d5-2209d6853628@gmail.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 23 Jun 2016, Michael Kerrisk (man-pages) wrote: > On 06/23/2016 09:18 AM, Thomas Gleixner wrote: > Once upon a time, you told me the following: > > On 15 May 2014 at 16:14, Thomas Gleixner wrote: > > On Thu, 15 May 2014, Michael Kerrisk (man-pages) wrote: > > > And that universe would love to have your documentation of > > > FUTEX_WAKE_BITSET and FUTEX_WAIT_BITSET ;-), > > > > I give you almost the full treatment, but I leave REQUEUE_PI to Darren > > and FUTEX_WAKE_OP to Jakub. :) > > [...] > > FUTEX_CLOCK_REALTIME > > > > This option bit can be ored on the futex ops FUTEX_WAIT_BITSET > > and FUTEX_WAIT_REQUEUE_PI > > > > If set the kernel treats the user space supplied timeout as > > absolute time based on CLOCK_REALTIME. > > > > If not set the kernel treats the user space supplied timeout > > as relative time. > Unfortunately, I should have checked the code more carefully... Me too :) > Looking more carefully at the code, I see understand the situation > is the following: > > FUTEX_LOCK_PI > Always uses CLOCK_REALTIME > 'timeout' is absolute Yes. > FUTEX_WAIT_REQUEUE_PI > Choice of clock (CLOCK_REALTIME vs CLOCK_MONOTONIC) is > determined by presence or absence of > FUTEX_CLOCK_REALTIME flag > 'timeout' is absolute Yes > FUTEX_WAIT_BITSET > Choice of clock (CLOCK_REALTIME vs CLOCK_MONOTONIC) is > determined by presence or absence of > FUTEX_CLOCK_REALTIME flag > 'timeout' is absolute Yes > FUTEX_WAIT > Choice of clock (CLOCK_REALTIME vs CLOCK_MONOTONIC) is > determined by presence or absence of > FUTEX_CLOCK_REALTIME flag > 'timeout' is relative Yes. > I've amended the man page to describe those details. > > > The flag was explicitely added to allow FUTEX_WAIT to hand in absolute time. > > When you say that the "flag was added", which flag do you mean? Or, did you > mean: "applying Matthieu's patch will allow FUTEX_WAIT to hand in absolute > time". I didn't express myself clearly. When Darren added the support for CLOCK_REALTIME to FUTEX_WAIT I think he wanted to add absolute timeout support. Anything else does not make sense. Thanks, tglx