From 4fd8c5f153bc41ae847b9ddb1539b34f70c18278 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Sun, 2 Jun 2019 13:41:08 -0700 Subject: rcu/nocb: Reduce ->nocb_lock contention with separate ->nocb_gp_lock The sleep/wakeup of the no-CBs grace-period kthreads is synchronized using the ->nocb_lock of the first CPU corresponding to that kthread. This commit provides a separate ->nocb_gp_lock for this purpose, thus reducing contention on ->nocb_lock. Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kernel/rcu/tree.h') diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 7062f9d9c053..2c3e9068671c 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -202,7 +202,8 @@ struct rcu_data { struct timer_list nocb_timer; /* Enforce finite deferral. */ /* The following fields are used by GP kthread, hence own cacheline. */ - bool nocb_gp_sleep ____cacheline_internodealigned_in_smp; + raw_spinlock_t nocb_gp_lock ____cacheline_internodealigned_in_smp; + bool nocb_gp_sleep; /* Is the nocb GP thread asleep? */ struct swait_queue_head nocb_gp_wq; /* For nocb kthreads to sleep on. */ bool nocb_cb_sleep; /* Is the nocb CB thread asleep? */ -- cgit