From: Greg Kroah-Hartman Date: Thu, 17 Oct 2024 09:33:30 +0000 (+0200) Subject: drop io_uring change from 5.10 and 5.15 X-Git-Tag: v5.10.227~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d052df43a429d26962aa20489f52520ac75d1b29;p=thirdparty%2Fkernel%2Fstable-queue.git drop io_uring change from 5.10 and 5.15 --- diff --git a/queue-5.10/io_uring-sqpoll-do-not-allow-pinning-outside-of-cpuset.patch b/queue-5.10/io_uring-sqpoll-do-not-allow-pinning-outside-of-cpuset.patch deleted file mode 100644 index 302112ec05d..00000000000 --- a/queue-5.10/io_uring-sqpoll-do-not-allow-pinning-outside-of-cpuset.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 0ce44d871d55dc7067d6ef85553ba52510a04337 Mon Sep 17 00:00:00 2001 -From: Felix Moessbauer -Date: Mon, 9 Sep 2024 17:00:36 +0200 -Subject: io_uring/sqpoll: do not allow pinning outside of cpuset - -From: Felix Moessbauer - -The submit queue polling threads are userland threads that just never -exit to the userland. When creating the thread with IORING_SETUP_SQ_AFF, -the affinity of the poller thread is set to the cpu specified in -sq_thread_cpu. However, this CPU can be outside of the cpuset defined -by the cgroup cpuset controller. This violates the rules defined by the -cpuset controller and is a potential issue for realtime applications. - -In b7ed6d8ffd6 we fixed the default affinity of the poller thread, in -case no explicit pinning is required by inheriting the one of the -creating task. In case of explicit pinning, the check is more -complicated, as also a cpu outside of the parent cpumask is allowed. -We implemented this by using cpuset_cpus_allowed (that has support for -cgroup cpusets) and testing if the requested cpu is in the set. - -Fixes: 37d1e2e3642e ("io_uring: move SQPOLL thread io-wq forked worker") -Cc: stable@vger.kernel.org # 6.1+ -Signed-off-by: Felix Moessbauer -Link: https://lore.kernel.org/r/20240909150036.55921-1-felix.moessbauer@siemens.com -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman ---- - io_uring/io_uring.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/io_uring/io_uring.c -+++ b/io_uring/io_uring.c -@@ -56,6 +56,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -8571,10 +8572,12 @@ static int io_sq_offload_create(struct i - return 0; - - if (p->flags & IORING_SETUP_SQ_AFF) { -+ struct cpumask allowed_mask; - int cpu = p->sq_thread_cpu; - - ret = -EINVAL; -- if (cpu >= nr_cpu_ids || !cpu_online(cpu)) -+ cpuset_cpus_allowed(current, &allowed_mask); -+ if (!cpumask_test_cpu(cpu, &allowed_mask)) - goto err_sqpoll; - sqd->sq_cpu = cpu; - } else { diff --git a/queue-5.15/io_uring-sqpoll-do-not-allow-pinning-outside-of-cpuset.patch b/queue-5.15/io_uring-sqpoll-do-not-allow-pinning-outside-of-cpuset.patch deleted file mode 100644 index 9f7cd044cdc..00000000000 --- a/queue-5.15/io_uring-sqpoll-do-not-allow-pinning-outside-of-cpuset.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 0ce44d871d55dc7067d6ef85553ba52510a04337 Mon Sep 17 00:00:00 2001 -From: Felix Moessbauer -Date: Mon, 9 Sep 2024 17:00:36 +0200 -Subject: io_uring/sqpoll: do not allow pinning outside of cpuset - -From: Felix Moessbauer - -The submit queue polling threads are userland threads that just never -exit to the userland. When creating the thread with IORING_SETUP_SQ_AFF, -the affinity of the poller thread is set to the cpu specified in -sq_thread_cpu. However, this CPU can be outside of the cpuset defined -by the cgroup cpuset controller. This violates the rules defined by the -cpuset controller and is a potential issue for realtime applications. - -In b7ed6d8ffd6 we fixed the default affinity of the poller thread, in -case no explicit pinning is required by inheriting the one of the -creating task. In case of explicit pinning, the check is more -complicated, as also a cpu outside of the parent cpumask is allowed. -We implemented this by using cpuset_cpus_allowed (that has support for -cgroup cpusets) and testing if the requested cpu is in the set. - -Fixes: 37d1e2e3642e ("io_uring: move SQPOLL thread io-wq forked worker") -Cc: stable@vger.kernel.org # 6.1+ -Signed-off-by: Felix Moessbauer -Link: https://lore.kernel.org/r/20240909150036.55921-1-felix.moessbauer@siemens.com -Signed-off-by: Jens Axboe -Signed-off-by: Greg Kroah-Hartman ---- - io_uring/io_uring.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/io_uring/io_uring.c -+++ b/io_uring/io_uring.c -@@ -56,6 +56,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -8746,10 +8747,12 @@ static int io_sq_offload_create(struct i - return 0; - - if (p->flags & IORING_SETUP_SQ_AFF) { -+ struct cpumask allowed_mask; - int cpu = p->sq_thread_cpu; - - ret = -EINVAL; -- if (cpu >= nr_cpu_ids || !cpu_online(cpu)) -+ cpuset_cpus_allowed(current, &allowed_mask); -+ if (!cpumask_test_cpu(cpu, &allowed_mask)) - goto err_sqpoll; - sqd->sq_cpu = cpu; - } else { diff --git a/queue-5.15/series b/queue-5.15/series index 1518c316ba7..40757011020 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -356,7 +356,6 @@ pps-remove-usage-of-the-deprecated-ida_simple_xx-api.patch pps-add-an-error-check-in-parport_attach.patch x86-idtentry-incorporate-definitions-declarations-of.patch x86-entry-remove-unwanted-instrumentation-in-common_.patch -io_uring-sqpoll-do-not-allow-pinning-outside-of-cpuset.patch bpf-lsm-set-bpf_lsm_blob_sizes.lbs_task-to-0.patch lockdep-fix-deadlock-issue-between-lockdep-and-rcu.patch mm-only-enforce-minimum-stack-gap-size-if-it-s-sensible.patch