summaryrefslogtreecommitdiffstats
path: root/kernel/rcu/rcu_segcblist.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2022-11-14 09:40:19 -0800
committerPaul E. McKenney <paulmck@kernel.org>2023-01-03 17:28:34 -0800
commit253cbbff621407a6265ce7a6a03c3766f8846f02 (patch)
treeba1996973ed6050657c93774b422ad544bf6d95d /kernel/rcu/rcu_segcblist.c
parent5a04848d005e051b8c063206b1a03363aca8ade4 (diff)
downloadlinux-stable-253cbbff621407a6265ce7a6a03c3766f8846f02.tar.gz
linux-stable-253cbbff621407a6265ce7a6a03c3766f8846f02.tar.bz2
linux-stable-253cbbff621407a6265ce7a6a03c3766f8846f02.zip
rcu: Throttle callback invocation based on number of ready callbacks
Currently, rcu_do_batch() sizes its batches based on the total number of callbacks in the callback list. This can result in some strange choices, for example, if there was 12,800 callbacks in the list, but only 200 were ready to invoke, RCU would invoke 100 at a time (12,800 shifted down by seven bits). A more measured approach would use the number that were actually ready to invoke, an approach that has become feasible only recently given the per-segment ->seglen counts in ->cblist. This commit therefore bases the batch limit on the number of callbacks ready to invoke instead of on the total number of callbacks. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu/rcu_segcblist.c')
-rw-r--r--kernel/rcu/rcu_segcblist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c
index c54ea2b6a36b..f71fac422c8f 100644
--- a/kernel/rcu/rcu_segcblist.c
+++ b/kernel/rcu/rcu_segcblist.c
@@ -89,7 +89,7 @@ static void rcu_segcblist_set_len(struct rcu_segcblist *rsclp, long v)
}
/* Get the length of a segment of the rcu_segcblist structure. */
-static long rcu_segcblist_get_seglen(struct rcu_segcblist *rsclp, int seg)
+long rcu_segcblist_get_seglen(struct rcu_segcblist *rsclp, int seg)
{
return READ_ONCE(rsclp->seglen[seg]);
}