Skip to content

RFC futex: Allow lockless empty check of hashbucket plist in futex_wake()

Thomas Gleixner lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 25 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5futex: Misc cleanupskernel/futex.c+12 -280 replies
2/5futex: Document ordering guaranteeskernel/futex.c+57 -00 replies
3/5futex: Split out unlock from queue_me()kernel/futex.c+16 -80 replies
4/5futex: Enqueue waiter before user space checkkernel/futex.c+49 -351 reply
5/5futex: Allow lockless empty check of hash bucket plistkernel/futex.c+91 -60 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchDarren Hart
1/5
2/5
3/5
4/5R-b
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC patch 0/5] futex: Allow lockless empty check of hashbucket plist in futex_wake()

The patch set from Davidlohr [1] tried to attempt the same via an atomic counter of waiters in a hash bucket. The atomic counter access provided enough serialization for x86 so that a failure is not observable in testing, but does not provide any guarantees.

The same can be achieved with a smp_mb() pair including proper guarantees for all architectures.

The following series provides an incremental approach to this and adds documentation of the ordering guarantees of futexes.

Note, this is RFC and needs a lot of review, testing and proper performance numbers for the following scenarios:

1) Test case where a single waiter is about to queue itself, i.e. the test case Davidlohr used to gather his numbers.

2) Test case where the hash bucket is always not empty. This allows us to determine the smp_mb() overhead for cases which are not optimized by the singler waiter per bucket.

These tests need to be done on x86 AND on other architectures where the smp_mb() might be more expensive than on x86.

Thanks,

tglx

---
[1] http://lkml.kernel.org/r/[email protected]