diff mbox series

[for-next,1/7] io_uring: use local ctx variable

Message ID 20220815130911.988014-2-dylany@fb.com (mailing list archive)
State New
Headers show
Series io_uring: defer task work to when it is needed | expand

Commit Message

Dylan Yudaken Aug. 15, 2022, 1:09 p.m. UTC
small change to use the local ctx

Signed-off-by: Dylan Yudaken <dylany@fb.com>
---
 io_uring/io_uring.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Pavel Begunkov Aug. 15, 2022, 1:46 p.m. UTC | #1
On 8/15/22 14:09, Dylan Yudaken wrote:
> small change to use the local ctx
> 
> Signed-off-by: Dylan Yudaken <dylany@fb.com>
> ---
>   io_uring/io_uring.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
> index ebfdb2212ec2..ab3e3d9e9fcd 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -1072,8 +1072,8 @@ void io_req_task_work_add(struct io_kiocb *req)
>   		req = container_of(node, struct io_kiocb, io_task_work.node);
>   		node = node->next;
>   		if (llist_add(&req->io_task_work.node,
> -			      &req->ctx->fallback_llist))
> -			schedule_delayed_work(&req->ctx->fallback_work, 1);
> +			      &ctx->fallback_llist))
> +			schedule_delayed_work(&ctx->fallback_work, 1);

Requests here can be from different rings, you can't use @ctx
from above
Dylan Yudaken Aug. 15, 2022, 3:16 p.m. UTC | #2
On Mon, 2022-08-15 at 14:46 +0100, Pavel Begunkov wrote:
> On 8/15/22 14:09, Dylan Yudaken wrote:
> > small change to use the local ctx
> > 
> > Signed-off-by: Dylan Yudaken <dylany@fb.com>
> > ---
> >   io_uring/io_uring.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
> > index ebfdb2212ec2..ab3e3d9e9fcd 100644
> > --- a/io_uring/io_uring.c
> > +++ b/io_uring/io_uring.c
> > @@ -1072,8 +1072,8 @@ void io_req_task_work_add(struct io_kiocb
> > *req)
> >                 req = container_of(node, struct io_kiocb,
> > io_task_work.node);
> >                 node = node->next;
> >                 if (llist_add(&req->io_task_work.node,
> > -                             &req->ctx->fallback_llist))
> > -                       schedule_delayed_work(&req->ctx-
> > >fallback_work, 1);
> > +                             &ctx->fallback_llist))
> > +                       schedule_delayed_work(&ctx->fallback_work,
> > 1);
> 
> Requests here can be from different rings, you can't use @ctx
> from above
> 

Ah - thats a completely miss by me. I'll remove this patch from the
series.
diff mbox series

Patch

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index ebfdb2212ec2..ab3e3d9e9fcd 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1072,8 +1072,8 @@  void io_req_task_work_add(struct io_kiocb *req)
 		req = container_of(node, struct io_kiocb, io_task_work.node);
 		node = node->next;
 		if (llist_add(&req->io_task_work.node,
-			      &req->ctx->fallback_llist))
-			schedule_delayed_work(&req->ctx->fallback_work, 1);
+			      &ctx->fallback_llist))
+			schedule_delayed_work(&ctx->fallback_work, 1);
 	}
 }