lkml.org 
[lkml]   [2023]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] rcu/tree: Improve comments in rcu_report_qs_rdp()
Date
Recent discussion triggered due to a patch linked below, from Qiang,
shed light on the need to accelerate from QS reporting paths.

Update the comments to capture this piece of knowledge.

Link: https://lore.kernel.org/all/20230118073014.2020743-1-qiang1.zhang@intel.com/
Cc: Qiang Zhang <Qiang1.zhang@intel.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>

---
kernel/rcu/tree.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 93eb03f8ed99..713eb6ca6902 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1983,7 +1983,12 @@ rcu_report_qs_rdp(struct rcu_data *rdp)
} else {
/*
* This GP can't end until cpu checks in, so all of our
- * callbacks can be processed during the next GP.
+ * callbacks can be processed during the next GP. Do
+ * the acceleration from here otherwise there may be extra
+ * grace period delays, as any accelerations from rcu_core()
+ * or note_gp_changes() may happen only after the GP after the
+ * current one has already started. Further, rcu_core()
+ * only accelerates if RCU is idle (no GP in progress).
*
* NOCB kthreads have their own way to deal with that...
*/
@@ -1993,6 +1998,12 @@ rcu_report_qs_rdp(struct rcu_data *rdp)
/*
* ...but NOCB kthreads may miss or delay callbacks acceleration
* if in the middle of a (de-)offloading process.
+ *
+ * Such missed acceleration may cause the callbacks to
+ * be stranded until RCU is fully de-offloaded, as
+ * acceleration from rcu_core() and note_gp_changes()
+ * cannot happen for fully/partially offloaded mode due
+ * to ordering dependency between rnp lock and nocb_lock.
*/
needacc = true;
}
--
2.39.1.519.gcb327c4b5f-goog
\
 
 \ /
  Last update: 2023-03-27 00:09    [W:0.109 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site