Skip to contentSkip to conversation

io_uring: add IORING_FEAT_FILES_SKIP feature flag

PATCH In review Drew DeVault 2 participants 6 messages May 17, 2021 – May 18, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: add IORING_FEAT_FILES_SKIP feature flag

This signals that the kernel supports IORING_REGISTER_FILES_SKIP.

---
 fs/io_uring.c                 | 3 ++-
 include/uapi/linux/io_uring.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
fs/io_uring.c +2 -1
index e481ac8a757a..6338c4892cd2 100644
@@ -9659,7 +9659,8 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p,
 			IORING_FEAT_SUBMIT_STABLE | IORING_FEAT_RW_CUR_POS |
 			IORING_FEAT_CUR_PERSONALITY | IORING_FEAT_FAST_POLL |
 			IORING_FEAT_POLL_32BITS | IORING_FEAT_SQPOLL_NONFIXED |
-			IORING_FEAT_EXT_ARG | IORING_FEAT_NATIVE_WORKERS;
+			IORING_FEAT_EXT_ARG | IORING_FEAT_NATIVE_WORKERS |
+			IORING_FEAT_FILES_SKIP;
 
 	if (copy_to_user(params, p, sizeof(*p))) {
 		ret = -EFAULT;
include/uapi/linux/io_uring.h +1 -0
index e1ae46683301..1b0887ab4d07 100644
@@ -280,6 +280,7 @@ struct io_uring_params {
 #define IORING_FEAT_SQPOLL_NONFIXED	(1U << 7)
 #define IORING_FEAT_EXT_ARG		(1U << 8)
 #define IORING_FEAT_NATIVE_WORKERS	(1U << 9)
+#define IORING_FEAT_FILES_SKIP		(1U << 10)
 
 /*
  * io_uring_register(2) opcodes and arguments
Signature · 1 line
2.31.1
#1 lore raw
Quoted 1 line · Drew DeVault

This signals that the kernel supports IORING_REGISTER_FILES_SKIP.

#define IORING_FEAT_FILES_SKIP IORING_FEAT_NATIVE_WORKERS

Maybe even solely in liburing. Any reason to have them separately? We keep compatibility anyway

Quoted 33 lines
---
 fs/io_uring.c                 | 3 ++-
 include/uapi/linux/io_uring.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
fs/io_uring.c +2 -1
index e481ac8a757a..6338c4892cd2 100644
@@ -9659,7 +9659,8 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p,
 			IORING_FEAT_SUBMIT_STABLE | IORING_FEAT_RW_CUR_POS |
 			IORING_FEAT_CUR_PERSONALITY | IORING_FEAT_FAST_POLL |
 			IORING_FEAT_POLL_32BITS | IORING_FEAT_SQPOLL_NONFIXED |
-			IORING_FEAT_EXT_ARG | IORING_FEAT_NATIVE_WORKERS;
+			IORING_FEAT_EXT_ARG | IORING_FEAT_NATIVE_WORKERS |
+			IORING_FEAT_FILES_SKIP;
 
 	if (copy_to_user(params, p, sizeof(*p))) {
 		ret = -EFAULT;
include/uapi/linux/io_uring.h +1 -0
index e1ae46683301..1b0887ab4d07 100644
@@ -280,6 +280,7 @@ struct io_uring_params {
 #define IORING_FEAT_SQPOLL_NONFIXED	(1U << 7)
 #define IORING_FEAT_EXT_ARG		(1U << 8)
 #define IORING_FEAT_NATIVE_WORKERS	(1U << 9)
+#define IORING_FEAT_FILES_SKIP		(1U << 10)
 
 /*
  * io_uring_register(2) opcodes and arguments
Signature · 1 line
Pavel Begunkov
#2 lore raw
Quoted 7 lines · Pavel Begunkov
Quoted 1 line · Drew DeVault

This signals that the kernel supports IORING_REGISTER_FILES_SKIP.

#define IORING_FEAT_FILES_SKIP IORING_FEAT_NATIVE_WORKERS

Maybe even solely in liburing. Any reason to have them separately? We keep compatibility anyway

What is the relationship between IORING_FEAT_NATIVE_WORKERS and IORING_REGISTER_FILES_SKIP? Actually, what is NATIVE_WORKERS? The documentation is sparse on this detail.

#3 lore raw
Quoted 4 lines · Drew DeVault
Quoted 3 lines · Pavel Begunkov
Quoted 1 line · Drew DeVault

This signals that the kernel supports IORING_REGISTER_FILES_SKIP.

Quoted 8 lines
Quoted 4 lines

#define IORING_FEAT_FILES_SKIP IORING_FEAT_NATIVE_WORKERS

Maybe even solely in liburing. Any reason to have them separately? We keep compatibility anyway

What is the relationship between IORING_FEAT_NATIVE_WORKERS and IORING_REGISTER_FILES_SKIP? Actually, what is NATIVE_WORKERS? The documentation is sparse on this detail.

They are not related by both came in 5.12, so if you have one you have another

Signature · 1 line
Pavel Begunkov
#4 lore raw
Quoted 6 lines · Pavel Begunkov
Quoted 3 lines

What is the relationship between IORING_FEAT_NATIVE_WORKERS and IORING_REGISTER_FILES_SKIP? Actually, what is NATIVE_WORKERS? The documentation is sparse on this detail.

They are not related by both came in 5.12, so if you have one you have another

Gotcha. I'm open to a simple alias in liburing, in that case. I'll send a new patch tomorrow morning.

#5 lore raw
Quoted 10 lines · Drew DeVault
Quoted 6 lines · Pavel Begunkov
Quoted 3 lines

What is the relationship between IORING_FEAT_NATIVE_WORKERS and IORING_REGISTER_FILES_SKIP? Actually, what is NATIVE_WORKERS? The documentation is sparse on this detail.

They are not related by both came in 5.12, so if you have one you have another

Gotcha. I'm open to a simple alias in liburing, in that case. I'll send a new patch tomorrow morning.

At least there won't be one release delay between feature and the flag this way as it can't lend earlier than 5.13

Signature · 1 line
Pavel Begunkov