diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2022-01-21 16:13:52 -0800 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2022-04-11 15:31:02 -0700 |
commit | 2ec303113d978931ef368886c4c6bc854493e8bf (patch) | |
tree | a3ac6e016db1e5e868f94859170e32f50b05dbd8 /include/linux/srcutree.h | |
parent | srcu: Make Tree SRCU able to operate without snp_node array (diff) | |
download | linux-dev-2ec303113d978931ef368886c4c6bc854493e8bf.tar.xz linux-dev-2ec303113d978931ef368886c4c6bc854493e8bf.zip |
srcu: Dynamically allocate srcu_node array
This commit shrinks the srcu_struct structure by converting its ->node
field from a fixed-size compile-time array to a pointer to a dynamically
allocated array. In kernels built with large values of NR_CPUS that boot
on systems with smaller numbers of CPUs, this can save significant memory.
[ paulmck: Apply kernel test robot feedback. ]
Reported-by: A cast of thousands
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 'include/linux/srcutree.h')
-rw-r--r-- | include/linux/srcutree.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/srcutree.h b/include/linux/srcutree.h index 8d1da136a93a..8501b6b45941 100644 --- a/include/linux/srcutree.h +++ b/include/linux/srcutree.h @@ -60,7 +60,7 @@ struct srcu_node { * Per-SRCU-domain structure, similar in function to rcu_state. */ struct srcu_struct { - struct srcu_node node[NUM_RCU_NODES]; /* Combining tree. */ + struct srcu_node *node; /* Combining tree. */ struct srcu_node *level[RCU_NUM_LVLS + 1]; /* First node at each level. */ int srcu_size_state; /* Small-to-big transition state. */ |