diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-04-22 22:44:23 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-06-22 17:42:09 +0300 |
commit | bf22a6976897977b0a3f1aeba6823c959fc4fdae (patch) | |
tree | 7cc9e19e17e0e2c9812b41e56bc623aea4688c75 /arch/xtensa | |
parent | e112c41341c03d9224a9fc522bdb3539bc849b56 (diff) | |
download | linux-bf22a6976897977b0a3f1aeba6823c959fc4fdae.tar.xz |
futex: Provide FUTEX_LOCK_PI2 to support clock selection
The FUTEX_LOCK_PI futex operand uses a CLOCK_REALTIME based absolute
timeout since it was implemented, but it does not require that the
FUTEX_CLOCK_REALTIME flag is set, because that was introduced later.
In theory as none of the user space implementations can set the
FUTEX_CLOCK_REALTIME flag on this operand, it would be possible to
creatively abuse it and make the meaning invers, i.e. select CLOCK_REALTIME
when not set and CLOCK_MONOTONIC when set. But that's a nasty hackery.
Another option would be to have a new FUTEX_CLOCK_MONOTONIC flag only for
FUTEX_LOCK_PI, but that's also awkward because it does not allow libraries
to handle the timeout clock selection consistently.
So provide a new FUTEX_LOCK_PI2 operand which implements the timeout
semantics which the other operands use and leave FUTEX_LOCK_PI alone.
Reported-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210422194705.440773992@linutronix.de
Diffstat (limited to 'arch/xtensa')
0 files changed, 0 insertions, 0 deletions