Skip to content
Commit 2bcd18e0 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

rcu-tasks: Use order_base_2() instead of ilog2()



The ilog2() function can be used to generate a shift count, but it will
generate the same count for a power of two as for one greater than a power
of two.  This results in shift counts that are larger than necessary for
systems with a power-of-two number of CPUs because the CPUs are numbered
from zero, so that the maximum CPU number is one less than that power
of two.

This commit therefore substitutes order_base_2(), which appears to have
been designed for exactly this use case.

Suggested-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent da123016
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment