Skip to content

Commit ff81428

Browse files
Frederic WeisbeckerNeeraj Upadhyay
authored andcommitted
rcu/nocb: Move nocb field at the end of state struct
nocb_is_setup is a rarely used field, mostly on boot and CPU hotplug. It shouldn't occupy the middle of the rcu state hot fields cacheline. Move it to the end and build it conditionally while at it. More cold NOCB fields are to come. Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Paul E. McKenney <[email protected]> Signed-off-by: Neeraj Upadhyay <[email protected]>
1 parent 7aeba70 commit ff81428

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/rcu/tree.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ struct rcu_state {
411411
arch_spinlock_t ofl_lock ____cacheline_internodealigned_in_smp;
412412
/* Synchronize offline with */
413413
/* GP pre-initialization. */
414-
int nocb_is_setup; /* nocb is setup from boot */
415414

416415
/* synchronize_rcu() part. */
417416
struct llist_head srs_next; /* request a GP users. */
@@ -420,6 +419,10 @@ struct rcu_state {
420419
struct sr_wait_node srs_wait_nodes[SR_NORMAL_GP_WAIT_HEAD_MAX];
421420
struct work_struct srs_cleanup_work;
422421
atomic_t srs_cleanups_pending; /* srs inflight worker cleanups. */
422+
423+
#ifdef CONFIG_RCU_NOCB_CPU
424+
int nocb_is_setup; /* nocb is setup from boot */
425+
#endif
423426
};
424427

425428
/* Values for rcu_state structure's gp_flags field. */

0 commit comments

Comments
 (0)