From 6a5581f7bdf3d478ef2f477629555644db8e46de Mon Sep 17 00:00:00 2001 From: Dimitri Sivanich Date: Fri, 29 Jun 2012 14:17:29 -0700 Subject: [PATCH] rcu: Segregate rcu_state fields to improve cache locality The fields in the rcu_state structure that are protected by the root rcu_node structure's ->lock can share a cache line with the fields protected by ->onofflock. This can result in excessive memory contention on large systems, so this commit applies ____cacheline_internodealigned_in_smp to the ->onofflock field in order to segregate them. Signed-off-by: Dimitri Sivanich Signed-off-by: Paul E. McKenney Tested-by: Dimitri Sivanich --- kernel/rcutree.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/rcutree.h b/kernel/rcutree.h index effb2733b7fc..5d92b80a0a28 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h @@ -394,7 +394,8 @@ struct rcu_state { /* End of fields guarded by root rcu_node's lock. */ - raw_spinlock_t onofflock; /* exclude on/offline and */ + raw_spinlock_t onofflock ____cacheline_internodealigned_in_smp; + /* exclude on/offline and */ /* starting new GP. */ struct rcu_head *orphan_nxtlist; /* Orphaned callbacks that */ /* need a grace period. */ -- 2.39.5