• Jens Axboe's avatar
    io_uring/napi: enable even with a timeout of 0 · b4ccc4dd
    Jens Axboe authored
    1 usec is not as short as it used to be, and it makes sense to allow 0
    for a busy poll timeout - this means just do one loop to check if we
    have anything available. Add a separate ->napi_enabled to check if napi
    has been enabled or not.
    
    While at it, move the writing of the ctx napi values after we've copied
    the old values back to userspace. This ensures that if the call fails,
    we'll be in the same state as we were before, rather than some
    indeterminate state.
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    b4ccc4dd
napi.c 7.65 KB