public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 5.12 0/2] minor fixes
@ 2021-03-22  1:45 Pavel Begunkov
  2021-03-22  1:45 ` [PATCH 1/2] io_uring: correct io_queue_async_work() traces Pavel Begunkov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pavel Begunkov @ 2021-03-22  1:45 UTC (permalink / raw)
  To: Jens Axboe, io-uring

Two minor fixes, nothing serious

Pavel Begunkov (2):
  io_uring: correct io_queue_async_work() traces
  io_uring: don't skip file_end_write() on reissue

 fs/io_uring.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

-- 
2.24.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] io_uring: correct io_queue_async_work() traces
  2021-03-22  1:45 [PATCH 5.12 0/2] minor fixes Pavel Begunkov
@ 2021-03-22  1:45 ` Pavel Begunkov
  2021-03-22  1:45 ` [PATCH 2/2] io_uring: don't skip file_end_write() on reissue Pavel Begunkov
  2021-03-22 13:40 ` [PATCH 5.12 0/2] minor fixes Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Pavel Begunkov @ 2021-03-22  1:45 UTC (permalink / raw)
  To: Jens Axboe, io-uring

Request's io-wq work is hashed in io_prep_async_link(), so
as trace_io_uring_queue_async_work() looks at it should follow after
prep has been done.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index ea2d3e120555..7f52fe924a11 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1239,10 +1239,10 @@ static void io_queue_async_work(struct io_kiocb *req)
 	BUG_ON(!tctx);
 	BUG_ON(!tctx->io_wq);
 
-	trace_io_uring_queue_async_work(ctx, io_wq_is_hashed(&req->work), req,
-					&req->work, req->flags);
 	/* init ->work of the whole link before punting */
 	io_prep_async_link(req);
+	trace_io_uring_queue_async_work(ctx, io_wq_is_hashed(&req->work), req,
+					&req->work, req->flags);
 	io_wq_enqueue(tctx->io_wq, &req->work);
 	if (link)
 		io_queue_linked_timeout(link);
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] io_uring: don't skip file_end_write() on reissue
  2021-03-22  1:45 [PATCH 5.12 0/2] minor fixes Pavel Begunkov
  2021-03-22  1:45 ` [PATCH 1/2] io_uring: correct io_queue_async_work() traces Pavel Begunkov
@ 2021-03-22  1:45 ` Pavel Begunkov
  2021-03-22 13:40 ` [PATCH 5.12 0/2] minor fixes Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Pavel Begunkov @ 2021-03-22  1:45 UTC (permalink / raw)
  To: Jens Axboe, io-uring

Don't miss to call kiocb_end_write() from __io_complete_rw() on reissue.
Shouldn't be much of a problem as the function actually does some work
only for ISREG, and NONBLOCK won't be reissued.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 7f52fe924a11..a00e8a40e44c 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2524,13 +2524,12 @@ static void __io_complete_rw(struct io_kiocb *req, long res, long res2,
 {
 	int cflags = 0;
 
+	if (req->rw.kiocb.ki_flags & IOCB_WRITE)
+		kiocb_end_write(req);
 	if ((res == -EAGAIN || res == -EOPNOTSUPP) && io_rw_reissue(req))
 		return;
 	if (res != req->result)
 		req_set_fail_links(req);
-
-	if (req->rw.kiocb.ki_flags & IOCB_WRITE)
-		kiocb_end_write(req);
 	if (req->flags & REQ_F_BUFFER_SELECTED)
 		cflags = io_put_rw_kbuf(req);
 	__io_req_complete(req, issue_flags, res, cflags);
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 5.12 0/2] minor fixes
  2021-03-22  1:45 [PATCH 5.12 0/2] minor fixes Pavel Begunkov
  2021-03-22  1:45 ` [PATCH 1/2] io_uring: correct io_queue_async_work() traces Pavel Begunkov
  2021-03-22  1:45 ` [PATCH 2/2] io_uring: don't skip file_end_write() on reissue Pavel Begunkov
@ 2021-03-22 13:40 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-03-22 13:40 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 3/21/21 7:45 PM, Pavel Begunkov wrote:
> Two minor fixes, nothing serious
> 
> Pavel Begunkov (2):
>   io_uring: correct io_queue_async_work() traces
>   io_uring: don't skip file_end_write() on reissue
> 
>  fs/io_uring.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Thanks, applied.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-22 13:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-22  1:45 [PATCH 5.12 0/2] minor fixes Pavel Begunkov
2021-03-22  1:45 ` [PATCH 1/2] io_uring: correct io_queue_async_work() traces Pavel Begunkov
2021-03-22  1:45 ` [PATCH 2/2] io_uring: don't skip file_end_write() on reissue Pavel Begunkov
2021-03-22 13:40 ` [PATCH 5.12 0/2] minor fixes Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox