diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-02-15 15:30:33 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-02-15 15:37:28 -0700 |
commit | b4ccc4dd1330a4d0db6aa4c6781631d1bab76c45 (patch) | |
tree | 9af256544b80381afafd99e2f5982da896148424 /include/linux/io_uring_types.h | |
parent | 871760eb7af57accc5402142154e64f21701fa16 (diff) |
io_uring/napi: enable even with a timeout of 0
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: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/io_uring_types.h')
-rw-r--r-- | include/linux/io_uring_types.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h index 4fe7af8a4907..bd7071aeec5d 100644 --- a/include/linux/io_uring_types.h +++ b/include/linux/io_uring_types.h @@ -420,6 +420,7 @@ struct io_ring_ctx { /* napi busy poll default timeout */ unsigned int napi_busy_poll_to; bool napi_prefer_busy_poll; + bool napi_enabled; DECLARE_HASHTABLE(napi_ht, 4); #endif |