]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.11-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Nov 2024 06:44:07 +0000 (07:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Nov 2024 06:44:07 +0000 (07:44 +0100)
added patches:
rcu-kvfree-refactor-kvfree_rcu_queue_batch.patch

queue-6.11/rcu-kvfree-refactor-kvfree_rcu_queue_batch.patch [new file with mode: 0644]
queue-6.11/series

diff --git a/queue-6.11/rcu-kvfree-refactor-kvfree_rcu_queue_batch.patch b/queue-6.11/rcu-kvfree-refactor-kvfree_rcu_queue_batch.patch
new file mode 100644 (file)
index 0000000..6386f89
--- /dev/null
@@ -0,0 +1,46 @@
+From 3c5d61ae919cc377c71118ccc76fa6e8518023f8 Mon Sep 17 00:00:00 2001
+From: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
+Date: Mon, 30 Sep 2024 13:37:10 +0200
+Subject: rcu/kvfree: Refactor kvfree_rcu_queue_batch()
+
+From: Uladzislau Rezki (Sony) <urezki@gmail.com>
+
+commit 3c5d61ae919cc377c71118ccc76fa6e8518023f8 upstream.
+
+Improve readability of kvfree_rcu_queue_batch() function
+in away that, after a first batch queuing, the loop is break
+and success value is returned to a caller.
+
+There is no reason to loop and check batches further as all
+outstanding objects have already been picked and attached to
+a certain batch to complete an offloading.
+
+Fixes: 2b55d6a42d14 ("rcu/kvfree: Add kvfree_rcu_barrier() API")
+Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
+Closes: https://lore.kernel.org/lkml/ZvWUt2oyXRsvJRNc@pc636/T/
+Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
+Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/rcu/tree.c |    9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+--- a/kernel/rcu/tree.c
++++ b/kernel/rcu/tree.c
+@@ -3627,11 +3627,12 @@ kvfree_rcu_queue_batch(struct kfree_rcu_
+                       }
+                       // One work is per one batch, so there are three
+-                      // "free channels", the batch can handle. It can
+-                      // be that the work is in the pending state when
+-                      // channels have been detached following by each
+-                      // other.
++                      // "free channels", the batch can handle. Break
++                      // the loop since it is done with this CPU thus
++                      // queuing an RCU work is _always_ success here.
+                       queued = queue_rcu_work(system_wq, &krwp->rcu_work);
++                      WARN_ON_ONCE(!queued);
++                      break;
+               }
+       }
index fdf4a3c4ecc21910f1ad0f97c51eab46c7bcc364..9d8d8efe5f176c3324261c156ad29d9b6ab7d385 100644 (file)
@@ -246,3 +246,4 @@ mips-export-__cmpxchg_small.patch
 risc-v-disallow-gcc-rust-builds.patch
 rcu-kvfree-add-kvfree_rcu_barrier-api.patch
 lib-alloc_tag_module_unload-must-wait-for-pending-kfree_rcu-calls.patch
+rcu-kvfree-refactor-kvfree_rcu_queue_batch.patch