Commit Graph

3 Commits

Author SHA1 Message Date
Jeff Moyer 539a8ed2d1 io_uring: remove struct io_tw_state::locked
JIRA: https://issues.redhat.com/browse/RHEL-64867

commit 8e5b3b89ecaf6d9295e561c225b35c574a5e0fe7
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Mon Mar 18 22:00:30 2024 +0000

    io_uring: remove struct io_tw_state::locked
    
    ctx is always locked for task_work now, so get rid of struct
    io_tw_state::locked. Note I'm stopping one step before removing
    io_tw_state altogether, which is not empty, because it still serves the
    purpose of indicating which function is a tw callback and forcing users
    not to invoke them carelessly out of a wrong context. The removal can
    always be done later.
    
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Tested-by: Ming Lei <ming.lei@redhat.com>
    Link: https://lore.kernel.org/r/e95e1ea116d0bfa54b656076e6a977bc221392a4.1710799188.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2024-11-28 16:28:44 -05:00
Jeff Moyer 2ee1019058 io_uring/waitid: always remove waitid entry for cancel all
JIRA: https://issues.redhat.com/browse/RHEL-27755

commit 2b35b8b43e07b1a6f06fdd84cf4b9eb24785896d
Author: Jens Axboe <axboe@kernel.dk>
Date:   Fri Mar 15 15:42:49 2024 -0600

    io_uring/waitid: always remove waitid entry for cancel all
    
    We know the request is either being removed, or already in the process of
    being removed through task_work, so we can delete it from our waitid list
    upfront. This is important for remove all conditions, as we otherwise
    will find it multiple times and prevent cancelation progress.
    
    Remove the dead check in cancelation as well for the hash_node being
    empty or not. We already have a waitid reference check for ownership,
    so we don't need to check the list too.
    
    Cc: stable@vger.kernel.org
    Fixes: f31ecf671ddc ("io_uring: add IORING_OP_WAITID support")
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2024-07-02 14:33:38 -04:00
Jeff Moyer 05243a1f83 io_uring: add IORING_OP_WAITID support
JIRA: https://issues.redhat.com/browse/RHEL-27755

commit f31ecf671ddc498f20219453395794ff2383e06b
Author: Jens Axboe <axboe@kernel.dk>
Date:   Mon Jul 10 16:14:37 2023 -0600

    io_uring: add IORING_OP_WAITID support
    
    This adds support for an async version of waitid(2), in a fully async
    version. If an event isn't immediately available, wait for a callback
    to trigger a retry.
    
    The format of the sqe is as follows:
    
    sqe->len                The 'which', the idtype being queried/waited for.
    sqe->fd                 The 'pid' (or id) being waited for.
    sqe->file_index         The 'options' being set.
    sqe->addr2              A pointer to siginfo_t, if any, being filled in.
    
    buf_index, add3, and waitid_flags are reserved/unused for now.
    waitid_flags will be used for options for this request type. One
    interesting use case may be to add multi-shot support, so that the
    request stays armed and posts a notification every time a monitored
    process state change occurs.
    
    Note that this does not support rusage, on Arnd's recommendation.
    
    See the waitid(2) man page for details on the arguments.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2024-07-02 09:47:34 -04:00