Lines Matching +full:- +full:gp
1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Read-Copy Update mechanism for mutual exclusion (tree-based version)
4 * Internal non-public definitions.
39 * Definition for node within the RCU grace-period-detection hierarchy.
45 unsigned long gp_seq; /* Track rsp->gp_seq. */
46 unsigned long gp_seq_needed; /* Track furthest future GP request. */
54 unsigned long rcu_gp_init_mask; /* Mask of offline CPUs at GP init. */
56 /* Per-GP initial value for qsmask. */
57 /* Initialized from ->qsmaskinitnext at the */
61 /* to allow the current expedited GP */
64 /* Per-GP initial values for expmask. */
65 /* Initialized from ->expmaskinitnext at the */
66 /* beginning of each expedited GP. */
68 /* Online CPUs for next expedited GP. */
72 /* Workers performing per node expedited GP */
79 int grplo; /* lowest-numbered CPU here. */
80 int grphi; /* highest-numbered CPU here. */
84 /* exit RCU read-side critical sections */
89 /* Tasks blocked in RCU read-side critical */
111 /* Used only for the priority-boosting */
126 /* Place for rcu_nocb_kthread() to wait GP. */
144 * This generates the bit for a CPU in node-local masks.
146 #define leaf_node_cpu_bit(rnp, cpu) (BIT((cpu) - (rnp)->grplo))
164 * equal to rdp->gp_seq.
167 unsigned long gp_seq; /* Track rdp->gp_seq counter */
177 /* Per-CPU data for read-copy update. */
179 /* 1) quiescent-state and grace-period handling : */
180 unsigned long gp_seq; /* Track rsp->gp_seq counter. */
181 unsigned long gp_seq_needed; /* Track furthest future GP request. */
185 bool gpwrap; /* Possible ->gp_seq wrap. */
186 unsigned int gpwrap_count; /* Count of GP sequence wrap. */
190 unsigned long ticks_this_gp; /* The number of scheduling-clock */
210 int watching_snap; /* Per-GP tracking for dynticks. */
211 bool rcu_need_heavy_qs; /* GP old, so heavy quiescent state! */
212 bool rcu_urgent_qs; /* GP old need light quiescent state. */
214 bool rcu_forced_tick_exp; /* ... provide QS to expedited GP. */
219 int exp_watching_snap; /* Double-check need for IPI. */
230 struct mutex nocb_gp_kthread_mutex; /* Exclusion for nocb gp kthread */
235 struct rcu_cblist nocb_bypass; /* Lock-contention-bypass CB list. */
237 unsigned long nocb_nobypass_last; /* Last ->cblist enqueue (jiffies). */
238 int nocb_nobypass_count; /* # ->cblist enqueues at ^^^ time. */
240 /* The following fields are used by GP kthread, hence own cacheline. */
242 u8 nocb_gp_sleep; /* Is the nocb GP thread asleep? */
244 u8 nocb_gp_gp; /* GP to wait for on last scan? */
245 unsigned long nocb_gp_seq; /* If so, ->gp_seq to wait for. */
255 struct rcu_data *nocb_toggling_rdp; /* rdp queued for (de-)offloading */
259 /* GP rdp takes GP-end wakeups. */
264 /* rcuc per-CPU kthread or NULL. */
271 /* ->rcu_iw* fields protected by leaf rcu_node ->lock. */
272 struct irq_work rcu_iw; /* Check for non-irq activity. */
273 bool rcu_iw_pending; /* Is ->rcu_iw pending? */
274 unsigned long rcu_iw_gp_seq; /* ->gp_seq associated with ->rcu_iw. */
275 unsigned long rcu_ofl_gp_seq; /* ->gp_seq at last offline. */
276 short rcu_ofl_gp_state; /* ->gp_state at last offline. */
277 unsigned long rcu_onl_gp_seq; /* ->gp_seq at last online. */
278 short rcu_onl_gp_state; /* ->gp_state at last online. */
301 /* quiescent-state forcing. */
334 * of the hierarchy is in ->node[0] (referenced by ->level[0]), the second
335 * level in ->node[1] through ->node[m] (->node[1] referenced by ->level[1]),
336 * and the third level in ->node[m+1] and following (->node[m+1] referenced
337 * by ->level[2]). The number of levels is determined by the number of
352 /* Grace-period sequence #. */
353 unsigned long gp_max; /* Maximum GP duration in */
356 struct swait_queue_head gp_wq; /* Where GP task waits. */
357 short gp_flags; /* Commands for GP task. */
358 short gp_state; /* GP kthread sleep state. */
359 unsigned long gp_wake_time; /* Last GP kthread wake. */
360 unsigned long gp_wake_seq; /* ->gp_seq at ^^^. */
361 unsigned long gp_seq_polled; /* GP seq for polled API. */
362 unsigned long gp_seq_polled_snap; /* ->gp_seq_polled at normal GP start. */
363 unsigned long gp_seq_polled_exp_snap; /* ->gp_seq_polled at expedited GP start. */
374 raw_spinlock_t barrier_lock; /* Protects ->barrier_seq_snap. */
376 struct mutex exp_mutex; /* Serialize expedited GP. */
380 struct swait_queue_head expedited_wq; /* Wait for check-ins. */
391 unsigned long gp_start; /* Time at which GP started, */
393 unsigned long gp_end; /* Time last GP ended, again */
395 unsigned long gp_activity; /* Time of last GP kthread */
397 unsigned long gp_req_activity; /* Time of last GP request */
408 /* GP start. */
414 /* GP pre-initialization. */
417 struct llist_head srs_next; /* request a GP users. */
418 struct llist_node *srs_wait_tail; /* wait for GP users. */
419 struct llist_node *srs_done_tail; /* ready for GP users. */
425 struct mutex nocb_mutex; /* Guards (de-)offloading */
431 #define RCU_GP_FLAG_INIT 0x1 /* Need grace-period initialization. */
432 #define RCU_GP_FLAG_FQS 0x2 /* Need grace-period quiescent-state forcing. */
436 #define RCU_GP_IDLE 0 /* Initial state and no GP in progress. */
437 #define RCU_GP_WAIT_GPS 1 /* Wait for grace-period start. */
438 #define RCU_GP_DONE_GPS 2 /* Wait done for grace-period start. */
439 #define RCU_GP_ONOFF 3 /* Grace-period initialization hotplug. */
440 #define RCU_GP_INIT 4 /* Grace-period initialization. */
441 #define RCU_GP_WAIT_FQS 5 /* Wait for force-quiescent-state time. */
442 #define RCU_GP_DOING_FQS 6 /* Wait done for force-quiescent-state time. */
443 #define RCU_GP_CLEANUP 7 /* Grace-period cleanup started. */
444 #define RCU_GP_CLEANED 8 /* Grace-period cleanup complete. */
513 * locking is safe against concurrent de-offloading.
518 if (rcu_segcblist_is_offloaded(&(rdp)->cblist)) \
519 raw_spin_lock(&(rdp)->nocb_lock); \