Thread (37 messages) 37 messages, 5 authors, 2019-01-10

Re: [PATCH 11/16] io_uring: batch io_kiocb allocation

flat view

From: Jens Axboe <axboe@kernel.dk>
Date: 2019-01-09 20:08:17
Also in: linux-arch, linux-fsdevel

On 1/9/19 12:03 PM, Christoph Hellwig wrote:
On Wed, Jan 09, 2019 at 09:57:59AM -0700, Jens Axboe wrote:
quoted
On 1/9/19 5:13 AM, Christoph Hellwig wrote:
quoted
quoted
+	if (!state)
+		req = kmem_cache_alloc(kiocb_cachep, GFP_KERNEL);
Just return an error here if kmem_cache_alloc fails.
quoted
+	if (req)
+		io_req_init(ctx, req);
Because all the other ones can't reached this with a NULL req.
This is different in the current tree, since I properly fixed the
ctx ref issue.
Your tree does a percpu_ref_tryget very first, and then leaks that if
kmem_cache_alloc_bulk fails, and also is inconsistent for NULL vs
ERR_PTR returns.  I think you want something like this on top:
I fixed it up while doing the rebase already. Just haven't pushed anything
out until I've had a chance to run it through testing.

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help