From: Paul E. McKenney Date: Sat, 1 Jun 2019 12:14:47 +0000 (-0700) Subject: rcu/nocb: Round down for number of no-CBs grace-period kthreads X-Git-Tag: v5.4-rc1~181^2~1^2^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9fcb09bddd56bae42319b606bae86e85c625f868;p=thirdparty%2Fkernel%2Flinux.git rcu/nocb: Round down for number of no-CBs grace-period kthreads Currently, when the square root of the number of CPUs is rounded down by int_sqrt(), this round-down is applied to the number of callback kthreads per grace-period kthreads. This makes almost no difference for large systems, but results in oddities such as three no-CBs grace-period kthreads for a five-CPU system, which is a bit excessive. This commit therefore causes the round-down to apply to the number of no-CBs grace-period kthreads, so that systems with from four to eight CPUs have only two no-CBs grace period kthreads. Signed-off-by: Paul E. McKenney --- diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 5f0894cec75d7..12212764ecd8d 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -2028,7 +2028,7 @@ static void __init rcu_organize_nocb_kthreads(void) if (!cpumask_available(rcu_nocb_mask)) return; if (ls == -1) { - ls = int_sqrt(nr_cpu_ids); + ls = nr_cpu_ids / int_sqrt(nr_cpu_ids); rcu_nocb_gp_stride = ls; }