linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/6] futex: Bugfixes and FUTEX_LOCK_PI2
@ 2021-04-22 19:44 Thomas Gleixner
  2021-04-22 19:44 ` [patch 1/6] Revert 337f13046ff0 ("futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op") Thomas Gleixner
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Thomas Gleixner @ 2021-04-22 19:44 UTC (permalink / raw)
  To: LKML
  Cc: Peter Zijlstra, Adhemerval Zanella, Lukasz Majewski,
	Florian Weimer, Carlos O'Donell, Michael Kerrisk (man-pages),
	Davidlohr Bueso, Ingo Molnar, Darren Hart, Andrei Vagin,
	Kurt Kanzenbach

The following series started off looking into supporting selectable clocks
for FUTEX_LOCK_PI which is hardcoded to CLOCK_REALTIME and cannot be
changed.

On the way I found two bugs related to the timeout handling:

  - The allowance for FUTEX_WAIT to use FUTEX_CLOCK_REALTIME is broken and
    never worked.

  - The recent time namespace support wreckaged FUTEX_LOCK_PI timeouts when
    the task belongs to a namespace which has an CLOCK_MONOTONIC offset.

Both should have been caught by that Gleixner dude when merging them,
but it seems he's getting old.

Not having a selectable clock for PI futexes is inconsistent because all
other interfaces have it. Unfortunately this was figured out by glibc folks
quite some time ago, but nobody told us :(

The nasty hack to support it would be to treat FUTEX_CLOCK_REALTIME inverse
for FUTEX_LOCK_PI, but that's a horrible idea. Adding a new flag to the
futex op, i.e. FUTEX_CLOCK_MONOTONIC would be possible, but that's yet
another variant which makes is harder for libraries to have a consistent
clock selection handling.

So I went the way to let FUTEX_LOCK_PI alone and to add FUTEX_LOCK_PI2
which handles the clocks the same way as the other operands.

Thoughts?

The series is also available from git:

  git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git futex

Thanks,

	tglx
---
 include/uapi/linux/futex.h |    1 
 kernel/futex.c             |   89 +++++++++++++++++++++++----------------------
 2 files changed, 47 insertions(+), 43 deletions(-)


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-06-23  8:19 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 19:44 [patch 0/6] futex: Bugfixes and FUTEX_LOCK_PI2 Thomas Gleixner
2021-04-22 19:44 ` [patch 1/6] Revert 337f13046ff0 ("futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op") Thomas Gleixner
2021-05-06 18:14   ` [tip: locking/urgent] " tip-bot2 for Thomas Gleixner
2021-04-22 19:44 ` [patch 2/6] futex: Do not apply time namespace adjustment on FUTEX_LOCK_PI Thomas Gleixner
2021-05-06 18:14   ` [tip: locking/urgent] " tip-bot2 for Thomas Gleixner
2021-04-22 19:44 ` [patch 3/6] futex: Get rid of the val2 conditional dance Thomas Gleixner
2021-04-23 21:40   ` André Almeida
2021-04-23 22:34     ` Thomas Gleixner
2021-04-23 23:21       ` André Almeida
2021-05-06 18:20   ` [tip: locking/urgent] " tip-bot2 for Thomas Gleixner
2021-04-22 19:44 ` [patch 4/6] futex: Make syscall entry points less convoluted Thomas Gleixner
2021-05-06 18:20   ` [tip: locking/urgent] " tip-bot2 for Thomas Gleixner
2021-04-22 19:44 ` [patch 5/6] futex: Prepare futex_lock_pi() for runtime clock selection Thomas Gleixner
2021-04-23  9:34   ` Lukasz Majewski
2021-04-23 10:08     ` Thomas Gleixner
2021-06-23  8:19   ` [tip: locking/core] " tip-bot2 for Thomas Gleixner
2021-04-22 19:44 ` [patch 6/6] futex: Provide FUTEX_LOCK_PI2 to support " Thomas Gleixner
2021-04-23 22:20   ` André Almeida
2021-04-23 22:36     ` Thomas Gleixner
2021-06-23  8:19   ` [tip: locking/core] " tip-bot2 for Thomas Gleixner
2021-05-05 12:59 ` [patch 0/6] futex: Bugfixes and FUTEX_LOCK_PI2 Peter Zijlstra
2021-05-05 13:51   ` Kurt Kanzenbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).