linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 00/10] futex: More Futex2 bits
@ 2023-07-14 13:38 Peter Zijlstra
  2023-07-14 13:39 ` [RFC][PATCH 01/10] futex: Clarify FUTEX2 flags Peter Zijlstra
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Peter Zijlstra @ 2023-07-14 13:38 UTC (permalink / raw)
  To: tglx, axboe
  Cc: linux-kernel, peterz, mingo, dvhart, dave, andrealmeid,
	Andrew Morton, urezki, hch, lstoakes, Arnd Bergmann, linux-api,
	linux-mm, linux-arch, malteskarupke

Hi,

Reviewing Jens' series to add io_uring futex support got me looking at futex
again, and I realized the current flags situation is a mess. After cleaning
that up I decided to continue and implement most of the missing flags for
futex2.

I initially also wanted to add a futex_wait() syscall, but given the amount and
kind of arguments that needs, that's just not going to work on 32bit.
futex_waitv() will have to do for now.

I've not yet done futex_requeue(), that's even worse than futex_wait() and I
think the only option is to do something like:

  sys_futex_requeue(struct futex_waitv __user futexes[2], unsigned int flags, int nr_wake, int nr_requeue)

Where we use struct futex_wativ to specify the two futexes (addr and flags) and
cmp value.

Additionally, robust futexes can fundamentally only support 32bit unless we go
make more lists.

The 'small' futex support is very limited, esp. when combined with FUTEX2_NUMA
mixing sizes is really not an option. The requeue variant above would be able
to specify different sizes for each futex and might just do.

The whole series is *very* lightly tested, as in, it builds and boots, but I've
not yet written a single line of user code to trigger any of the new paths.

Please handle with care etc.. ;-)


Jens, given you do a completely new futex interface, it probably makes more
sense if you use FUTEX2 flags and a u64 value and mask.

I'm hoping this series clarifies that situation a little instead of making it a
worse mess. Many of these things have been brewing over the past several years
but nobody put it all together before.



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

end of thread, other threads:[~2023-07-14 20:10 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14 13:38 [RFC][PATCH 00/10] futex: More Futex2 bits Peter Zijlstra
2023-07-14 13:39 ` [RFC][PATCH 01/10] futex: Clarify FUTEX2 flags Peter Zijlstra
2023-07-14 13:39 ` [RFC][PATCH 02/10] futex: Extend the " Peter Zijlstra
2023-07-14 13:39 ` [RFC][PATCH 03/10] futex: Flag conversion Peter Zijlstra
2023-07-14 13:39 ` [RFC][PATCH 04/10] futex: Add sys_futex_wake() Peter Zijlstra
2023-07-14 14:26   ` Arnd Bergmann
2023-07-14 14:47     ` Peter Zijlstra
2023-07-14 20:10       ` Arnd Bergmann
2023-07-14 13:39 ` [RFC][PATCH 05/10] mm: Add vmalloc_huge_node() Peter Zijlstra
2023-07-14 14:37   ` Matthew Wilcox
2023-07-14 15:09     ` Peter Zijlstra
2023-07-14 15:11       ` Matthew Wilcox
2023-07-14 15:26         ` Peter Zijlstra
2023-07-14 13:39 ` [RFC][PATCH 06/10] futex: Propagate flags into get_futex_key() Peter Zijlstra
2023-07-14 13:39 ` [RFC][PATCH 07/10] futex: Implement FUTEX2_NUMA Peter Zijlstra
2023-07-14 15:22   ` Peter Zijlstra
2023-07-14 13:39 ` [RFC][PATCH 08/10] futex: Propagate flags into futex_get_value_locked() Peter Zijlstra
2023-07-14 13:39 ` [RFC][PATCH 09/10] futex: Enable FUTEX2_{8,16} Peter Zijlstra
2023-07-14 13:39 ` [HACK][PATCH 10/10] futex: Munge size and numa into the legacy interface Peter Zijlstra

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