-
- Downloads
io_uring: get rid of alloc cache init_once handling
init_once is called when an object doesn't come from the cache, and
hence needs initial clearing of certain members. While the whole
struct could get cleared by memset() in that case, a few of the cache
members are large enough that this may cause unnecessary overhead if
the caches used aren't large enough to satisfy the workload. For those
cases, some churn of kmalloc+kfree is to be expected.
Ensure that the 3 users that need clearing put the members they need
cleared at the start of the struct, and wrap the rest of the struct in
a struct group so the offset is known.
While at it, improve the interaction with KASAN such that when/if
KASAN writes to members inside the struct that should be retained over
caching, it won't trip over itself. For rw and net, the retaining of
the iovec over caching is disabled if KASAN is enabled. A helper will
free and clear those members in that case.
Signed-off-by:
Jens Axboe <axboe@kernel.dk>
Showing
- include/linux/io_uring/cmd.h 1 addition, 1 deletioninclude/linux/io_uring/cmd.h
- include/linux/io_uring_types.h 2 additions, 1 deletioninclude/linux/io_uring_types.h
- io_uring/alloc_cache.h 34 additions, 9 deletionsio_uring/alloc_cache.h
- io_uring/futex.c 2 additions, 2 deletionsio_uring/futex.c
- io_uring/io_uring.c 7 additions, 5 deletionsio_uring/io_uring.c
- io_uring/io_uring.h 2 additions, 3 deletionsio_uring/io_uring.h
- io_uring/net.c 6 additions, 22 deletionsio_uring/net.c
- io_uring/net.h 12 additions, 8 deletionsio_uring/net.h
- io_uring/poll.c 1 addition, 1 deletionio_uring/poll.c
- io_uring/rw.c 6 additions, 21 deletionsio_uring/rw.c
- io_uring/rw.h 16 additions, 11 deletionsio_uring/rw.h
- io_uring/uring_cmd.c 2 additions, 9 deletionsio_uring/uring_cmd.c
Loading
Please register or sign in to comment