diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2022-01-26 17:03:06 -0800 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2022-04-11 15:31:03 -0700 |
commit | cbdc98e93efa7bbf6f2fcd68c73df82c37b5fa65 (patch) | |
tree | 3ab78411e05c417c91340227f1b22952e0d05569 /kernel/range.c | |
parent | aeb9b39b8f4aac1233302c53a1fd99a73fd2c262 (diff) | |
download | linux-cbdc98e93efa7bbf6f2fcd68c73df82c37b5fa65.tar.gz linux-cbdc98e93efa7bbf6f2fcd68c73df82c37b5fa65.tar.bz2 linux-cbdc98e93efa7bbf6f2fcd68c73df82c37b5fa65.zip |
srcu: Use invalid initial value for srcu_node GP sequence numbers
Currently, tree SRCU relies on the srcu_node structures being initialized
at the same time that the srcu_struct itself is initialized, and thus
use the initial grace-period sequence number as the initial value for
the srcu_node structure's ->srcu_have_cbs[] and ->srcu_gp_seq_needed_exp
fields. Although this has a high probability of also working when the
srcu_node array is allocated and initialized at some random later time,
it would be better to avoid leaving such things to chance.
This commit therefore initializes these fields with 0x2, which is a
recognizable invalid value. It then adds the required checks for this
invalid value in order to avoid confusion on long-running kernels
(especially those on 32-bit systems) that allocate and initialize
srcu_node arrays late in life.
Co-developed-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Signed-off-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/range.c')
0 files changed, 0 insertions, 0 deletions