* [PATCH] io_uring: use IO_REQ_LINK_FLAGS more
@ 2025-02-11 20:19 Caleb Sander Mateos
2025-02-12 16:24 ` lizetao
2025-02-12 18:16 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Caleb Sander Mateos @ 2025-02-11 20:19 UTC (permalink / raw)
To: Jens Axboe, Pavel Begunkov; +Cc: Caleb Sander Mateos, io-uring, linux-kernel
Replace the 2 instances of REQ_F_LINK | REQ_F_HARDLINK with
the more commonly used IO_REQ_LINK_FLAGS.
Signed-off-by: Caleb Sander Mateos <[email protected]>
---
io_uring/io_uring.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index ec98a0ec6f34..8bb8c099c3e1 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -108,15 +108,17 @@
IOSQE_IO_HARDLINK | IOSQE_ASYNC)
#define SQE_VALID_FLAGS (SQE_COMMON_FLAGS | IOSQE_BUFFER_SELECT | \
IOSQE_IO_DRAIN | IOSQE_CQE_SKIP_SUCCESS)
+#define IO_REQ_LINK_FLAGS (REQ_F_LINK | REQ_F_HARDLINK)
+
#define IO_REQ_CLEAN_FLAGS (REQ_F_BUFFER_SELECTED | REQ_F_NEED_CLEANUP | \
REQ_F_POLLED | REQ_F_INFLIGHT | REQ_F_CREDS | \
REQ_F_ASYNC_DATA)
-#define IO_REQ_CLEAN_SLOW_FLAGS (REQ_F_REFCOUNT | REQ_F_LINK | REQ_F_HARDLINK |\
+#define IO_REQ_CLEAN_SLOW_FLAGS (REQ_F_REFCOUNT | IO_REQ_LINK_FLAGS | \
REQ_F_REISSUE | IO_REQ_CLEAN_FLAGS)
#define IO_TCTX_REFS_CACHE_NR (1U << 10)
#define IO_COMPL_BATCH 32
@@ -129,11 +131,10 @@ struct io_defer_entry {
u32 seq;
};
/* requests with any of those set should undergo io_disarm_next() */
#define IO_DISARM_MASK (REQ_F_ARM_LTIMEOUT | REQ_F_LINK_TIMEOUT | REQ_F_FAIL)
-#define IO_REQ_LINK_FLAGS (REQ_F_LINK | REQ_F_HARDLINK)
/*
* No waiters. It's larger than any valid value of the tw counter
* so that tests against ->cq_wait_nr would fail and skip wake_up().
*/
@@ -1155,11 +1156,11 @@ static inline void io_req_local_work_add(struct io_kiocb *req,
/*
* We don't know how many reuqests is there in the link and whether
* they can even be queued lazily, fall back to non-lazy.
*/
- if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK))
+ if (req->flags & IO_REQ_LINK_FLAGS)
flags &= ~IOU_F_TWQ_LAZY_WAKE;
guard(rcu)();
head = READ_ONCE(ctx->work_llist.first);
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] io_uring: use IO_REQ_LINK_FLAGS more
2025-02-11 20:19 [PATCH] io_uring: use IO_REQ_LINK_FLAGS more Caleb Sander Mateos
@ 2025-02-12 16:24 ` lizetao
2025-02-12 18:16 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: lizetao @ 2025-02-12 16:24 UTC (permalink / raw)
To: Caleb Sander Mateos, Jens Axboe, Pavel Begunkov
Cc: [email protected], [email protected]
Hi,
> -----Original Message-----
> From: Caleb Sander Mateos <[email protected]>
> Sent: Wednesday, February 12, 2025 4:20 AM
> To: Jens Axboe <[email protected]>; Pavel Begunkov <[email protected]>
> Cc: Caleb Sander Mateos <[email protected]>; io-
> [email protected]; [email protected]
> Subject: [PATCH] io_uring: use IO_REQ_LINK_FLAGS more
>
> Replace the 2 instances of REQ_F_LINK | REQ_F_HARDLINK with the more
> commonly used IO_REQ_LINK_FLAGS.
>
> Signed-off-by: Caleb Sander Mateos <[email protected]>
> ---
> io_uring/io_uring.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index
> ec98a0ec6f34..8bb8c099c3e1 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -108,15 +108,17 @@
> IOSQE_IO_HARDLINK | IOSQE_ASYNC)
>
> #define SQE_VALID_FLAGS (SQE_COMMON_FLAGS |
> IOSQE_BUFFER_SELECT | \
> IOSQE_IO_DRAIN | IOSQE_CQE_SKIP_SUCCESS)
>
> +#define IO_REQ_LINK_FLAGS (REQ_F_LINK | REQ_F_HARDLINK)
> +
> #define IO_REQ_CLEAN_FLAGS (REQ_F_BUFFER_SELECTED |
> REQ_F_NEED_CLEANUP | \
> REQ_F_POLLED | REQ_F_INFLIGHT |
> REQ_F_CREDS | \
> REQ_F_ASYNC_DATA)
>
> -#define IO_REQ_CLEAN_SLOW_FLAGS (REQ_F_REFCOUNT | REQ_F_LINK |
> REQ_F_HARDLINK |\
> +#define IO_REQ_CLEAN_SLOW_FLAGS (REQ_F_REFCOUNT |
> IO_REQ_LINK_FLAGS | \
> REQ_F_REISSUE | IO_REQ_CLEAN_FLAGS)
>
> #define IO_TCTX_REFS_CACHE_NR (1U << 10)
>
> #define IO_COMPL_BATCH 32
> @@ -129,11 +131,10 @@ struct io_defer_entry {
> u32 seq;
> };
>
> /* requests with any of those set should undergo io_disarm_next() */ #define
> IO_DISARM_MASK (REQ_F_ARM_LTIMEOUT | REQ_F_LINK_TIMEOUT |
> REQ_F_FAIL) -#define IO_REQ_LINK_FLAGS (REQ_F_LINK | REQ_F_HARDLINK)
>
> /*
> * No waiters. It's larger than any valid value of the tw counter
> * so that tests against ->cq_wait_nr would fail and skip wake_up().
> */
> @@ -1155,11 +1156,11 @@ static inline void io_req_local_work_add(struct
> io_kiocb *req,
>
> /*
> * We don't know how many reuqests is there in the link and whether
> * they can even be queued lazily, fall back to non-lazy.
> */
> - if (req->flags & (REQ_F_LINK | REQ_F_HARDLINK))
> + if (req->flags & IO_REQ_LINK_FLAGS)
> flags &= ~IOU_F_TWQ_LAZY_WAKE;
>
> guard(rcu)();
>
> head = READ_ONCE(ctx->work_llist.first);
> --
> 2.45.2
>
Reviewed-by: Li Zetao <[email protected]>
---
Li Zetao
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] io_uring: use IO_REQ_LINK_FLAGS more
2025-02-11 20:19 [PATCH] io_uring: use IO_REQ_LINK_FLAGS more Caleb Sander Mateos
2025-02-12 16:24 ` lizetao
@ 2025-02-12 18:16 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2025-02-12 18:16 UTC (permalink / raw)
To: Pavel Begunkov, Caleb Sander Mateos; +Cc: io-uring, linux-kernel
On Tue, 11 Feb 2025 13:19:56 -0700, Caleb Sander Mateos wrote:
> Replace the 2 instances of REQ_F_LINK | REQ_F_HARDLINK with
> the more commonly used IO_REQ_LINK_FLAGS.
>
>
Applied, thanks!
[1/1] io_uring: use IO_REQ_LINK_FLAGS more
commit: fddceb353d686cf377d8b630ff6e3cdcb69ef4fb
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-12 18:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-11 20:19 [PATCH] io_uring: use IO_REQ_LINK_FLAGS more Caleb Sander Mateos
2025-02-12 16:24 ` lizetao
2025-02-12 18:16 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox