Lines Matching +full:- +full:gp
1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Sleepable Read-Copy Update mechanism for mutual exclusion,
21 * Per-CPU structure feeding into leaf srcu_node, similar in function
25 /* Read-side state. */
31 /* Update-side state. */
34 unsigned long srcu_gp_seq_needed; /* Furthest future GP needed. */
35 unsigned long srcu_gp_seq_needed_exp; /* Furthest future exp GP. */
42 /* ->srcu_data_have_cbs[]. */
52 unsigned long srcu_have_cbs[4]; /* GP seq for children having CBs, but only */
53 /* if greater than ->srcu_gp_seq. */
54 unsigned long srcu_data_have_cbs[4]; /* Which srcu_data structs have CBs for given GP? */
55 unsigned long srcu_gp_seq_needed_exp; /* Furthest future exp GP. */
62 * Per-SRCU-domain structure, update-side data linked from srcu_struct.
68 int srcu_size_state; /* Small-to-big transition state. */
71 struct mutex srcu_gp_mutex; /* Serialize GP work. */
72 unsigned long srcu_gp_seq; /* Grace-period seq #. */
74 unsigned long srcu_gp_seq_needed_exp; /* Furthest future exp GP. */
75 unsigned long srcu_gp_start; /* Last GP start timestamp (jiffies) */
76 unsigned long srcu_last_gp_end; /* Last GP end timestamp (ns) */
77 unsigned long srcu_size_jiffies; /* Current contention-measurement interval. */
79 unsigned long srcu_n_exp_nodelay; /* # expedited no-delays in current GP phase. */
80 bool sda_is_static; /* May ->sda be passed to free_percpu()? */
95 * Per-SRCU-domain structure, similar in function to rcu_state.
99 struct srcu_data __percpu *sda; /* Per-CPU srcu_data array. */
101 struct srcu_usage *srcu_sup; /* Update-side data. */
104 // Values for size state variable (->srcu_size_state). Once the state
105 // has been set to SRCU_SIZE_ALLOC, the grace-period code advances through
109 #define SRCU_SIZE_SMALL 0 // No srcu_node combining tree, ->node == NULL
111 // and then referenced by ->node. It will not be used.
118 // invocations that were running on a non-boot CPU
121 #define SRCU_SIZE_WAIT_CBS1 4 // Don't trust the ->srcu_have_cbs[] grace-period
122 #define SRCU_SIZE_WAIT_CBS2 5 // sequence elements or the ->srcu_data_have_cbs[]
123 #define SRCU_SIZE_WAIT_CBS3 6 // CPU-bitmask elements until all four elements of
128 /* Values for state variable (bottom bits of ->srcu_gp_seq). */
134 * Values for initializing gp sequence fields. Higher values allow wrap arounds to
141 #define SRCU_GP_SEQ_INITIAL_VAL ((0UL - 100UL) << RCU_SEQ_CTR_SHIFT)
142 #define SRCU_GP_SEQ_INITIAL_VAL_WITH_STATE (SRCU_GP_SEQ_INITIAL_VAL - 1)
170 * Do -not- call init_srcu_struct() nor cleanup_srcu_struct() on it.
173 * files, the per-CPU variable rules nevertheless require that the
185 * See include/linux/percpu-defs.h for the rules on per-CPU variables.
209 * Counts the new reader in the appropriate per-CPU element of the
213 * Note that this_cpu_inc() is an RCU read-side critical section either
215 * or because it is a read-modify-write atomic operation, depending on
223 idx = READ_ONCE(ssp->srcu_idx) & 0x1; in __srcu_read_lock_lite()
224 this_cpu_inc(ssp->sda->srcu_lock_count[idx].counter); /* Y */ in __srcu_read_lock_lite()
231 * per-CPU element of the srcu_struct. Note that this may well be a
235 * Note that this_cpu_inc() is an RCU read-side critical section either
237 * or because it is a read-modify-write atomic operation, depending on
243 this_cpu_inc(ssp->sda->srcu_unlock_count[idx].counter); /* Z */ in __srcu_read_unlock_lite()
252 struct srcu_data *sdp = raw_cpu_ptr(ssp->sda); in srcu_check_read_flavor_lite()
254 if (likely(READ_ONCE(sdp->srcu_reader_flavor) & SRCU_READ_FLAVOR_LITE)) in srcu_check_read_flavor_lite()
261 // Record non-_lite() usage only for CONFIG_PROVE_RCU=y kernels.