2022-05-24 07:05:03 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
#
|
|
|
|
# Makefile for io_uring
|
|
|
|
|
2022-05-25 11:25:19 +08:00
|
|
|
obj-$(CONFIG_IO_URING) += io_uring.o xattr.o nop.o fs.o splice.o \
|
2022-05-25 11:54:43 +08:00
|
|
|
sync.o advise.o filetable.o \
|
2022-05-25 20:12:18 +08:00
|
|
|
openclose.o uring_cmd.o epoll.o \
|
2022-05-25 23:13:39 +08:00
|
|
|
statx.o net.o msg_ring.o timeout.o \
|
2022-05-26 10:36:47 +08:00
|
|
|
sqpoll.o fdinfo.o tctx.o poll.o \
|
2023-07-11 06:14:37 +08:00
|
|
|
cancel.o kbuf.o rsrc.o rw.o opdef.o \
|
2023-12-19 23:54:20 +08:00
|
|
|
notif.o waitid.o register.o
|
2022-05-24 07:05:03 +08:00
|
|
|
obj-$(CONFIG_IO_WQ) += io-wq.o
|
io_uring: add support for futex wake and wait
Add support for FUTEX_WAKE/WAIT primitives.
IORING_OP_FUTEX_WAKE is mix of FUTEX_WAKE and FUTEX_WAKE_BITSET, as
it does support passing in a bitset.
Similary, IORING_OP_FUTEX_WAIT is a mix of FUTEX_WAIT and
FUTEX_WAIT_BITSET.
For both of them, they are using the futex2 interface.
FUTEX_WAKE is straight forward, as those can always be done directly from
the io_uring submission without needing async handling. For FUTEX_WAIT,
things are a bit more complicated. If the futex isn't ready, then we
rely on a callback via futex_queue->wake() when someone wakes up the
futex. From that calback, we queue up task_work with the original task,
which will post a CQE and wake it, if necessary.
Cancelations are supported, both from the application point-of-view,
but also to be able to cancel pending waits if the ring exits before
all events have occurred. The return value of futex_unqueue() is used
to gate who wins the potential race between cancelation and futex
wakeups. Whomever gets a 'ret == 1' return from that claims ownership
of the io_uring futex request.
This is just the barebones wait/wake support. PI or REQUEUE support is
not added at this point, unclear if we might look into that later.
Likewise, explicit timeouts are not supported either. It is expected
that users that need timeouts would do so via the usual io_uring
mechanism to do that using linked timeouts.
The SQE format is as follows:
`addr` Address of futex
`fd` futex2(2) FUTEX2_* flags
`futex_flags` io_uring specific command flags. None valid now.
`addr2` Value of futex
`addr3` Mask to wake/wait
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-06-09 01:57:40 +08:00
|
|
|
obj-$(CONFIG_FUTEX) += futex.o
|