Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1429850

Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op
Date 2016-06-23 15:50 +0200
Message-ID <rNdb4-2hy-41@gated-at.bofh.it> (permalink)
References <rM8wO-ZK-9@gated-at.bofh.it> <rN4Kt-4Wx-1@gated-at.bofh.it> <rN7fj-6FF-11@gated-at.bofh.it> <rNawy-gR-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <tglx@linutronix.de> 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Matthieu CASTET <matthieu.castet@parrot.com> - 2016-06-20 16:40 +0200
  Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Darren Hart <dvhart@infradead.org> - 2016-06-23 06:50 +0200
    Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Thomas Gleixner <tglx@linutronix.de> - 2016-06-23 09:30 +0200
      Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2016-06-23 13:00 +0200
        Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Thomas Gleixner <tglx@linutronix.de> - 2016-06-23 15:50 +0200
          Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Darren Hart <dvhart@infradead.org> - 2016-06-23 18:20 +0200
            Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Thomas Gleixner <tglx@linutronix.de> - 2016-06-23 19:30 +0200
              Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Darren Hart <dvhart@infradead.org> - 2016-06-23 20:30 +0200
                Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2016-06-23 20:50 +0200
                Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Darren Hart <dvhart@infradead.org> - 2016-06-23 22:00 +0200
                Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Darren Hart <dvhart@infradead.org> - 2016-06-23 22:40 +0200
                Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Thomas Gleixner <tglx@linutronix.de> - 2016-06-24 12:00 +0200
                Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2016-06-24 12:10 +0200
                Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Thomas Gleixner <tglx@linutronix.de> - 2016-07-06 21:10 +0200
            Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2016-06-23 20:40 +0200
              Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op Darren Hart <dvhart@infradead.org> - 2016-06-23 22:00 +0200
                Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2016-06-24 10:20 +0200
    Re: futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> - 2016-06-23 13:00 +0200

csiph-web