Skip to content

Commit bae6076

Browse files
Frederic WeisbeckerNeeraj Upadhyay
authored andcommitted
rcu/nocb: Remove SEGCBLIST_RCU_CORE
RCU core can't be running anymore while in the middle of (de-)offloading since this sort of transition now only applies to offline CPUs. The SEGCBLIST_RCU_CORE state can therefore be removed. 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 df7c249 commit bae6076

File tree

4 files changed

+4
-26
lines changed

4 files changed

+4
-26
lines changed

include/linux/rcu_segcblist.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,10 @@ struct rcu_cblist {
185185
* ----------------------------------------------------------------------------
186186
*/
187187
#define SEGCBLIST_ENABLED BIT(0)
188-
#define SEGCBLIST_RCU_CORE BIT(1)
189-
#define SEGCBLIST_LOCKING BIT(2)
190-
#define SEGCBLIST_KTHREAD_CB BIT(3)
191-
#define SEGCBLIST_KTHREAD_GP BIT(4)
192-
#define SEGCBLIST_OFFLOADED BIT(5)
188+
#define SEGCBLIST_LOCKING BIT(1)
189+
#define SEGCBLIST_KTHREAD_CB BIT(2)
190+
#define SEGCBLIST_KTHREAD_GP BIT(3)
191+
#define SEGCBLIST_OFFLOADED BIT(4)
193192

194193
struct rcu_segcblist {
195194
struct rcu_head *head;

kernel/rcu/rcu_segcblist.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,6 @@ static inline bool rcu_segcblist_is_offloaded(struct rcu_segcblist *rsclp)
9595
return false;
9696
}
9797

98-
static inline bool rcu_segcblist_completely_offloaded(struct rcu_segcblist *rsclp)
99-
{
100-
if (IS_ENABLED(CONFIG_RCU_NOCB_CPU) &&
101-
!rcu_segcblist_test_flags(rsclp, SEGCBLIST_RCU_CORE))
102-
return true;
103-
104-
return false;
105-
}
106-
10798
/*
10899
* Are all segments following the specified segment of the specified
109100
* rcu_segcblist structure empty of callbacks? (The specified

kernel/rcu/tree.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ static void rcu_sr_normal_gp_cleanup_work(struct work_struct *);
7979

8080
static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, rcu_data) = {
8181
.gpwrap = true,
82-
#ifdef CONFIG_RCU_NOCB_CPU
83-
.cblist.flags = SEGCBLIST_RCU_CORE,
84-
#endif
8582
};
8683
static struct rcu_state rcu_state = {
8784
.level = { &rcu_state.node[0] },

kernel/rcu/tree_nocb.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,6 @@ static int rcu_nocb_rdp_deoffload(struct rcu_data *rdp)
10601060
WARN_ON_ONCE(rcu_cblist_n_cbs(&rdp->nocb_bypass));
10611061
WARN_ON_ONCE(rcu_segcblist_n_cbs(&rdp->cblist));
10621062

1063-
rcu_segcblist_set_flags(cblist, SEGCBLIST_RCU_CORE);
10641063
wake_gp = rdp_offload_toggle(rdp, false, flags);
10651064

10661065
mutex_lock(&rdp_gp->nocb_gp_kthread_mutex);
@@ -1168,13 +1167,6 @@ static int rcu_nocb_rdp_offload(struct rcu_data *rdp)
11681167
swait_event_exclusive(rdp->nocb_state_wq,
11691168
rcu_segcblist_test_flags(cblist, SEGCBLIST_KTHREAD_GP));
11701169

1171-
/*
1172-
* All kthreads are ready to work, we can finally enable nocb bypass.
1173-
*/
1174-
rcu_nocb_lock_irqsave(rdp, flags);
1175-
rcu_segcblist_clear_flags(cblist, SEGCBLIST_RCU_CORE);
1176-
rcu_nocb_unlock_irqrestore(rdp, flags);
1177-
11781170
return 0;
11791171
}
11801172

@@ -1350,7 +1342,6 @@ void __init rcu_init_nohz(void)
13501342
rcu_segcblist_init(&rdp->cblist);
13511343
rcu_segcblist_offload(&rdp->cblist, true);
13521344
rcu_segcblist_set_flags(&rdp->cblist, SEGCBLIST_KTHREAD_GP);
1353-
rcu_segcblist_clear_flags(&rdp->cblist, SEGCBLIST_RCU_CORE);
13541345
}
13551346
rcu_organize_nocb_kthreads();
13561347
}

0 commit comments

Comments
 (0)