[lkml]   [2020]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] rcu/tree: nocb: Avoid raising softirq when CBs ready to execute
During testing, I see it is possible that rcu_pending() returns 1 when
offloaded callbacks are ready to execute thus raising the RCU softirq.

However, softirq does not execute offloaded callbacks. They are executed in a
kthread which is awakened independent of the softirq. The softirq ignores the

This commit therefore avoids raising the softirq in the first place.
Considering that the purpose of callback offloading is to reduce softirq
activity, avoiding the softirq in the first place is the right thing to do
especially for systems that employ callback offloading to reduce real-time

Passed 30 minute tests of TREE01 through TREE09 each.

Signed-off-by: Joel Fernandes (Google) <>

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

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 55d3700dd1e7..caea5bfec2c0 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3759,7 +3759,8 @@ static int rcu_pending(int user)
return 1;

/* Does this CPU have callbacks ready to invoke? */
- if (rcu_segcblist_ready_cbs(&rdp->cblist))
+ if (!rcu_segcblist_is_offloaded(&rdp->cblist) &&
+ rcu_segcblist_ready_cbs(&rdp->cblist))
return 1;

/* Has RCU gone idle with this CPU needing another grace period? */
 \ /
  Last update: 2020-09-28 14:47    [W:0.027 / U:36.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site