Skip to contentSkip to conversation

io_uring: enable I/O Uring before testing

PATCH In review Li Wang 2 participants 5 messages Aug 8, 2023 – Aug 10, 2023

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 io_uring: enable I/O Uring before testing

Given that the upstream kernel is going to introduce io_uring_disabled knob which disables the creation of new io_uring instances system-wide.

The new sysctl is designed to let a user with root on the machine enable and disable io_uring system-wide at runtime without requiring a kernel recompilation or a reboot.

See: https://patchwork.kernel.org/project/io-uring/patch/[email protected]/

Without this patch, LTP/io_uring test complains:

io_uring01.c:82: TFAIL: io_uring_setup() failed: EPERM (1) io_uring02.c:213: TBROK: io_uring_setup() failed: EPERM (1)

---
 testcases/kernel/syscalls/io_uring/io_uring01.c | 5 +++++
 testcases/kernel/syscalls/io_uring/io_uring02.c | 5 +++++
 2 files changed, 10 insertions(+)
testcases/kernel/syscalls/io_uring/io_uring01.c +5 -0
index 70151bb85..ab1ec00d6 100644
@@ -264,5 +264,10 @@ static struct tst_test test = {
 	.bufs = (struct tst_buffers []) {
 		{&iov, .iov_sizes = (int[]){BLOCK_SZ, -1}},
 		{}
+	},
+	.save_restore = (const struct tst_path_val[]) {
+		{"/proc/sys/kernel/io_uring_disabled", "0",
+			TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+		{}
 	}
 };
testcases/kernel/syscalls/io_uring/io_uring02.c +5 -0
index c5c770074..c9d4bbcb1 100644
@@ -255,6 +255,11 @@ static struct tst_test test = {
 		TST_CAP(TST_CAP_REQ, CAP_SYS_CHROOT),
 		{}
 	},
+	.save_restore = (const struct tst_path_val[]) {
+		{"/proc/sys/kernel/io_uring_disabled", "0",
+			TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+		{}
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "9392a27d88b9"},
 		{"linux-git", "ff002b30181d"},
Signature · 5 lines
2.40.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw
Quoted 7 lines · Li Wang

Given that the upstream kernel is going to introduce io_uring_disabled knob which disables the creation of new io_uring instances system-wide.

The new sysctl is designed to let a user with root on the machine enable and disable io_uring system-wide at runtime without requiring a kernel recompilation or a reboot.

Quoted 6 lines

See: https://patchwork.kernel.org/project/io-uring/patch/[email protected]/

Without this patch, LTP/io_uring test complains:

io_uring01.c:82: TFAIL: io_uring_setup() failed: EPERM (1) io_uring02.c:213: TBROK: io_uring_setup() failed: EPERM (1)

Just to be clear, with the above kernel patch applied io_uring is enabled by default. You shouldn't need to set the sysctl parameter unless io_uring is explicitly disabled by the administrator (that can be accomplished via the kernel command line, sysfs, or via sysctl.conf).

Cheers,
Jeff

Quoted 39 lines
---
 testcases/kernel/syscalls/io_uring/io_uring01.c | 5 +++++
 testcases/kernel/syscalls/io_uring/io_uring02.c | 5 +++++
 2 files changed, 10 insertions(+)
testcases/kernel/syscalls/io_uring/io_uring01.c +5 -0
index 70151bb85..ab1ec00d6 100644
@@ -264,5 +264,10 @@ static struct tst_test test = {
 	.bufs = (struct tst_buffers []) {
 		{&iov, .iov_sizes = (int[]){BLOCK_SZ, -1}},
 		{}
+	},
+	.save_restore = (const struct tst_path_val[]) {
+		{"/proc/sys/kernel/io_uring_disabled", "0",
+			TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+		{}
 	}
 };
testcases/kernel/syscalls/io_uring/io_uring02.c +5 -0
index c5c770074..c9d4bbcb1 100644
@@ -255,6 +255,11 @@ static struct tst_test test = {
 		TST_CAP(TST_CAP_REQ, CAP_SYS_CHROOT),
 		{}
 	},
+	.save_restore = (const struct tst_path_val[]) {
+		{"/proc/sys/kernel/io_uring_disabled", "0",
+			TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+		{}
+	},
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "9392a27d88b9"},
 		{"linux-git", "ff002b30181d"},
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#2 lore raw

Hi Jeff,

Thanks for comments.

Quoted 14 lines · Jeff Moyer
Quoted 8 lines · Li Wang

Given that the upstream kernel is going to introduce io_uring_disabled knob which disables the creation of new io_uring instances system-wide.

The new sysctl is designed to let a user with root on the machine enable and disable io_uring system-wide at runtime without requiring a kernel recompilation or a reboot.

See:

https://patchwork.kernel.org/project/io-uring/patch/[email protected]/

Quoted 3 lines

Without this patch, LTP/io_uring test complains:

Quoted 8 lines
Quoted 2 lines

io_uring01.c:82: TFAIL: io_uring_setup() failed: EPERM (1) io_uring02.c:213: TBROK: io_uring_setup() failed: EPERM (1)

Just to be clear, with the above kernel patch applied io_uring is enabled by default. You shouldn't need to set the sysctl parameter unless io_uring is explicitly disabled by the administrator (that can be accomplished via the kernel command line, sysfs, or via sysctl.conf).

Yes, but it won't be harmful to set the parameter even if it's enabled by default,
LTP uses save_restore field to manage sysfs knob unified, it guarantees the tests can really get performed whatever io_uring is enabled or disabled.

I would keep the patch as it is unless you insist or others have an objection.

Quoted 47 lines

Cheers,
Jeff

Review

Quoted 9 lines
---
 testcases/kernel/syscalls/io_uring/io_uring01.c | 5 +++++
 testcases/kernel/syscalls/io_uring/io_uring02.c | 5 +++++
 2 files changed, 10 insertions(+)
(quoted diff) +0 -0

b/testcases/kernel/syscalls/io_uring/io_uring01.c

Review

Quoted 15 lines

index 70151bb85..ab1ec00d6 100644

testcases/kernel/syscalls/io_uring/io_uring01.c +5 -0
@@ -264,5 +264,10 @@ static struct tst_test test = {
      .bufs = (struct tst_buffers []) {
              {&iov, .iov_sizes = (int[]){BLOCK_SZ, -1}},
              {}
+     },
+     .save_restore = (const struct tst_path_val[]) {
+             {"/proc/sys/kernel/io_uring_disabled", "0",
+                     TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+             {}
      }
 };
(quoted diff) +0 -0

b/testcases/kernel/syscalls/io_uring/io_uring02.c

Quoted 15 lines

index c5c770074..c9d4bbcb1 100644

testcases/kernel/syscalls/io_uring/io_uring02.c +5 -0
@@ -255,6 +255,11 @@ static struct tst_test test = {
              TST_CAP(TST_CAP_REQ, CAP_SYS_CHROOT),
              {}
      },
+     .save_restore = (const struct tst_path_val[]) {
+             {"/proc/sys/kernel/io_uring_disabled", "0",
+                     TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+             {}
+     },
      .tags = (const struct tst_tag[]) {
              {"linux-git", "9392a27d88b9"},
              {"linux-git", "ff002b30181d"},
Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw
Quoted 29 lines · Li Wang

Hi Jeff,

Thanks for comments.

Quoted 14 lines · Jeff Moyer
Quoted 8 lines · Li Wang

Given that the upstream kernel is going to introduce io_uring_disabled knob which disables the creation of new io_uring instances system-wide.

The new sysctl is designed to let a user with root on the machine enable and disable io_uring system-wide at runtime without requiring a kernel recompilation or a reboot.

See:

https://patchwork.kernel.org/project/io-uring/patch/[email protected]/

Quoted 3 lines

Without this patch, LTP/io_uring test complains:

Quoted 8 lines
Quoted 2 lines

io_uring01.c:82: TFAIL: io_uring_setup() failed: EPERM (1) io_uring02.c:213: TBROK: io_uring_setup() failed: EPERM (1)

Just to be clear, with the above kernel patch applied io_uring is enabled by default. You shouldn't need to set the sysctl parameter unless io_uring is explicitly disabled by the administrator (that can be accomplished via the kernel command line, sysfs, or via sysctl.conf).

Quoted 7 lines

Yes, but it won't be harmful to set the parameter even if it's enabled by default,
LTP uses save_restore field to manage sysfs knob unified, it guarantees the tests can really get performed whatever io_uring is enabled or disabled.

I would keep the patch as it is unless you insist or others have an objection.

I agree with the patch. I just think the description should be updated, as it implies that, without the patch, the test will fail. This is not the case for an upstream kernel.

Thanks!
Jeff

Quoted 49 lines
Quoted 49 lines

Cheers,
Jeff

Review

Quoted 9 lines
---
 testcases/kernel/syscalls/io_uring/io_uring01.c | 5 +++++
 testcases/kernel/syscalls/io_uring/io_uring02.c | 5 +++++
 2 files changed, 10 insertions(+)
(quoted diff) +0 -0

b/testcases/kernel/syscalls/io_uring/io_uring01.c

Review

Quoted 15 lines

index 70151bb85..ab1ec00d6 100644

testcases/kernel/syscalls/io_uring/io_uring01.c +5 -0
@@ -264,5 +264,10 @@ static struct tst_test test = {
      .bufs = (struct tst_buffers []) {
              {&iov, .iov_sizes = (int[]){BLOCK_SZ, -1}},
              {}
+     },
+     .save_restore = (const struct tst_path_val[]) {
+             {"/proc/sys/kernel/io_uring_disabled", "0",
+                     TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+             {}
      }
 };
(quoted diff) +0 -0

b/testcases/kernel/syscalls/io_uring/io_uring02.c

Quoted 15 lines

index c5c770074..c9d4bbcb1 100644

testcases/kernel/syscalls/io_uring/io_uring02.c +5 -0
@@ -255,6 +255,11 @@ static struct tst_test test = {
              TST_CAP(TST_CAP_REQ, CAP_SYS_CHROOT),
              {}
      },
+     .save_restore = (const struct tst_path_val[]) {
+             {"/proc/sys/kernel/io_uring_disabled", "0",
+                     TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+             {}
+     },
      .tags = (const struct tst_tag[]) {
              {"linux-git", "9392a27d88b9"},
              {"linux-git", "ff002b30181d"},
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#4 lore raw
Quoted 37 lines · Jeff Moyer
Quoted 10 lines · Li Wang

Hi Jeff,

Thanks for comments.

Quoted 4 lines · Jeff Moyer
Quoted 2 lines · Li Wang

Given that the upstream kernel is going to introduce io_uring_disabled knob which disables the creation of new io_uring instances

system-wide.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

The new sysctl is designed to let a user with root on the machine enable and disable io_uring system-wide at runtime without requiring a kernel recompilation or a reboot.

See:

https://patchwork.kernel.org/project/io-uring/patch/[email protected]/

Quoted 12 lines
Quoted 11 lines
Quoted 5 lines

Without this patch, LTP/io_uring test complains:

io_uring01.c:82: TFAIL: io_uring_setup() failed: EPERM (1) io_uring02.c:213: TBROK: io_uring_setup() failed: EPERM (1)

Just to be clear, with the above kernel patch applied io_uring is enabled by default. You shouldn't need to set the sysctl parameter unless io_uring is explicitly disabled by the administrator (that can be accomplished via the kernel command line, sysfs, or via sysctl.conf).

Quoted 3 lines

Yes, but it won't be harmful to set the parameter even if it's enabled by default,
LTP uses save_restore field to manage sysfs knob unified, it guarantees

the

Quoted 9 lines
Quoted 4 lines

tests can really get performed whatever io_uring is enabled or disabled.

I would keep the patch as it is unless you insist or others have an objection.

I agree with the patch. I just think the description should be updated, as it implies that, without the patch, the test will fail. This is not the case for an upstream kernel.

Ah, sorry for the unclear description, I actually was not mean that. anyway, I rewrote it and pushed.

Thanks for your reveiw, Jeff.

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp