io_uring: retry bulk slab allocs as single allocs
authorJens Axboe <axboe@kernel.dk>
Thu, 14 Mar 2019 22:30:06 +0000 (16:30 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Mar 2019 16:44:44 +0000 (10:44 -0600)
commitfd6fab2cb78d3b6023c26ec53e0aa6f0b477d2f7
tree6f30a949748bf44ad926b9331cfa27556e9715cd
parent8c838788775a593527803786d376393b7c28f589
io_uring: retry bulk slab allocs as single allocs

I've seen cases where bulk alloc fails, since the bulk alloc API
is all-or-nothing - either we get the number we ask for, or it
returns 0 as number of entries.

If we fail a batch bulk alloc, retry a "normal" kmem_cache_alloc()
and just use that instead of failing with -EAGAIN.

While in there, ensure we use GFP_KERNEL. That was an oversight in
the original code, when we switched away from GFP_ATOMIC.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c