Blame view
kernel/rcu/rcu_segcblist.h
3.71 KB
eb7935e47 rcu/rcu_segcblist... |
1 |
/* SPDX-License-Identifier: GPL-2.0+ */ |
45753c5f3 srcu: Debloat the... |
2 |
/* |
98059b986 rcu: Separately c... |
3 |
* RCU segmented callback lists, internal-to-rcu header file |
45753c5f3 srcu: Debloat the... |
4 |
* |
45753c5f3 srcu: Debloat the... |
5 6 |
* Copyright IBM Corporation, 2017 * |
eb7935e47 rcu/rcu_segcblist... |
7 |
* Authors: Paul E. McKenney <paulmck@linux.ibm.com> |
45753c5f3 srcu: Debloat the... |
8 9 10 |
*/ #include <linux/rcu_segcblist.h> |
eda669a6a rcu/nocb: Atomic ... |
11 12 13 14 15 |
/* Return number of callbacks in the specified callback list. */ static inline long rcu_cblist_n_cbs(struct rcu_cblist *rclp) { return READ_ONCE(rclp->len); } |
98059b986 rcu: Separately c... |
16 |
void rcu_cblist_init(struct rcu_cblist *rclp); |
d1b222c6b rcu/nocb: Add byp... |
17 18 19 20 |
void rcu_cblist_enqueue(struct rcu_cblist *rclp, struct rcu_head *rhp); void rcu_cblist_flush_enqueue(struct rcu_cblist *drclp, struct rcu_cblist *srclp, struct rcu_head *rhp); |
98059b986 rcu: Separately c... |
21 |
struct rcu_head *rcu_cblist_dequeue(struct rcu_cblist *rclp); |
45753c5f3 srcu: Debloat the... |
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
/* * Is the specified rcu_segcblist structure empty? * * But careful! The fact that the ->head field is NULL does not * necessarily imply that there are no callbacks associated with * this structure. When callbacks are being invoked, they are * removed as a group. If callback invocation must be preempted, * the remaining callbacks will be added back to the list. Either * way, the counts are updated later. * * So it is often the case that rcu_segcblist_n_cbs() should be used * instead. */ static inline bool rcu_segcblist_empty(struct rcu_segcblist *rsclp) { |
e6060b41c rcu/nocb: Allow l... |
38 |
return !READ_ONCE(rsclp->head); |
45753c5f3 srcu: Debloat the... |
39 40 41 42 43 |
} /* Return number of callbacks in segmented callback list. */ static inline long rcu_segcblist_n_cbs(struct rcu_segcblist *rsclp) { |
eda669a6a rcu/nocb: Atomic ... |
44 45 46 |
#ifdef CONFIG_RCU_NOCB_CPU return atomic_long_read(&rsclp->len); #else |
45753c5f3 srcu: Debloat the... |
47 |
return READ_ONCE(rsclp->len); |
eda669a6a rcu/nocb: Atomic ... |
48 |
#endif |
45753c5f3 srcu: Debloat the... |
49 |
} |
45753c5f3 srcu: Debloat the... |
50 51 |
/* * Is the specified rcu_segcblist enabled, for example, not corresponding |
e83e73f5b rcu/nocb: Leave -... |
52 |
* to an offline CPU? |
45753c5f3 srcu: Debloat the... |
53 54 55 |
*/ static inline bool rcu_segcblist_is_enabled(struct rcu_segcblist *rsclp) { |
1bb5f9b95 rcu/nocb: Use sep... |
56 |
return rsclp->enabled; |
45753c5f3 srcu: Debloat the... |
57 |
} |
ce5215c13 rcu/nocb: Use sep... |
58 59 60 61 62 |
/* Is the specified rcu_segcblist offloaded? */ static inline bool rcu_segcblist_is_offloaded(struct rcu_segcblist *rsclp) { return rsclp->offloaded; } |
45753c5f3 srcu: Debloat the... |
63 |
/* |
45753c5f3 srcu: Debloat the... |
64 65 66 67 68 69 |
* Are all segments following the specified segment of the specified * rcu_segcblist structure empty of callbacks? (The specified * segment might well contain callbacks.) */ static inline bool rcu_segcblist_restempty(struct rcu_segcblist *rsclp, int seg) { |
76c6927c3 rcu/nocb: Allow l... |
70 |
return !READ_ONCE(*READ_ONCE(rsclp->tails[seg])); |
45753c5f3 srcu: Debloat the... |
71 |
} |
d1b222c6b rcu/nocb: Add byp... |
72 |
void rcu_segcblist_inc_len(struct rcu_segcblist *rsclp); |
98059b986 rcu: Separately c... |
73 74 |
void rcu_segcblist_init(struct rcu_segcblist *rsclp); void rcu_segcblist_disable(struct rcu_segcblist *rsclp); |
ce5215c13 rcu/nocb: Use sep... |
75 |
void rcu_segcblist_offload(struct rcu_segcblist *rsclp); |
98059b986 rcu: Separately c... |
76 77 |
bool rcu_segcblist_ready_cbs(struct rcu_segcblist *rsclp); bool rcu_segcblist_pend_cbs(struct rcu_segcblist *rsclp); |
98059b986 rcu: Separately c... |
78 79 |
struct rcu_head *rcu_segcblist_first_cb(struct rcu_segcblist *rsclp); struct rcu_head *rcu_segcblist_first_pend_cb(struct rcu_segcblist *rsclp); |
5d6742b37 rcu/nocb: Use rcu... |
80 |
bool rcu_segcblist_nextgp(struct rcu_segcblist *rsclp, unsigned long *lp); |
98059b986 rcu: Separately c... |
81 |
void rcu_segcblist_enqueue(struct rcu_segcblist *rsclp, |
77a40f970 rcu: Remove kfree... |
82 |
struct rcu_head *rhp); |
98059b986 rcu: Separately c... |
83 |
bool rcu_segcblist_entrain(struct rcu_segcblist *rsclp, |
77a40f970 rcu: Remove kfree... |
84 |
struct rcu_head *rhp); |
98059b986 rcu: Separately c... |
85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
void rcu_segcblist_extract_count(struct rcu_segcblist *rsclp, struct rcu_cblist *rclp); void rcu_segcblist_extract_done_cbs(struct rcu_segcblist *rsclp, struct rcu_cblist *rclp); void rcu_segcblist_extract_pend_cbs(struct rcu_segcblist *rsclp, struct rcu_cblist *rclp); void rcu_segcblist_insert_count(struct rcu_segcblist *rsclp, struct rcu_cblist *rclp); void rcu_segcblist_insert_done_cbs(struct rcu_segcblist *rsclp, struct rcu_cblist *rclp); void rcu_segcblist_insert_pend_cbs(struct rcu_segcblist *rsclp, struct rcu_cblist *rclp); void rcu_segcblist_advance(struct rcu_segcblist *rsclp, unsigned long seq); bool rcu_segcblist_accelerate(struct rcu_segcblist *rsclp, unsigned long seq); |
f2dbe4a56 rcu: Localize rcu... |
99 100 |
void rcu_segcblist_merge(struct rcu_segcblist *dst_rsclp, struct rcu_segcblist *src_rsclp); |