History

Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull RCU updates from Ingo Molnar: "The RCU changes in this cycle were: - Expedited grace-period updates - kfree_rcu() updates - RCU list updates - Preemptible RCU updates - Torture-test updates - Miscellaneous fixes - Documentation updates" * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (69 commits) rcu: Remove unused stop-machine #include powerpc: Remove comment about read_barrier_depends() .mailmap: Add entries for old paulmck@kernel.org addresses srcu: Apply *_ONCE() to ->srcu_last_gp_end rcu: Switch force_qs_rnp() to for_each_leaf_node_cpu_mask() rcu: Move rcu_{expedited,normal} definitions into rcupdate.h rcu: Move gp_state_names[] and gp_state_getname() to tree_stall.h rcu: Remove the declaration of call_rcu() in tree.h rcu: Fix tracepoint tracking RCU CPU kthread utilization rcu: Fix harmless omission of "CONFIG_" from #if condition rcu: Avoid tick_dep_set_cpu() misordering rcu: Provide wrappers for uses of ->rcu_read_lock_nesting rcu: Use READ_ONCE() for ->expmask in rcu_read_unlock_special() rcu: Clear ->rcu_read_unlock_special only once rcu: Clear .exp_hint only when deferred quiescent state has been reported rcu: Rename some instance of CONFIG_PREEMPTION to CONFIG_PREEMPT_RCU rcu: Remove kfree_call_rcu_nobatch() rcu: Remove kfree_rcu() special casing and lazy-callback handling rcu: Add support for debug_objects debugging for kfree_rcu() rcu: Add multiple in-flight batches of kfree_rcu() work ...

Linus Torvalds committed 6 years ago

Commit d99391e2 parents 8b56177 f8a4bb646 files · +1476 −851Browse files

Showing the changes to include/linux (9 of 46 files). Show all

Unified · Split

9 files
  1. include/linux/list.h +112 −24
  2. include/linux/list_nulls.h +26 −4
  3. include/linux/rcu_segcblist.h +0 −2
  4. include/linux/rculist.h +24 −14
  5. include/linux/rculist_nulls.h +14 −6
  6. include/linux/rcupdate.h +8 −20
  7. include/linux/rcutiny.h +1 −0
  8. include/linux/rcutree.h +1 −0
  9. include/linux/tick.h +4 −1
include/linux/list.h+112−24
@@ -23,6 +23,13 @@ · 22 unmodified lines
2323 #define LIST_HEAD(name) \
2424 struct list_head name = LIST_HEAD_INIT(name)
2525
26+/**
27+ * INIT_LIST_HEAD - Initialize a list_head structure
28+ * @list: list_head structure to be initialized.
29+ *
30+ * Initializes the list_head to point to itself. If it is a list header,
31+ * the result is an empty list.
32+ */
2633 static inline void INIT_LIST_HEAD(struct list_head *list)
2734 {
2835 WRITE_ONCE(list->next, list);
@@ -120,12 +127,6 @@ static inline void __list_del_clearprev(struct list_head *entry) · 91 unmodified lines
120127 entry->prev = NULL;
121128 }
122129
123−/**
124− * list_del - deletes entry from list.
125− * @entry: the element to delete from the list.
126− * Note: list_empty() on entry does not return true after this, the entry is
127− * in an undefined state.
128− */
129130 static inline void __list_del_entry(struct list_head *entry)
130131 {
131132 if (!__list_del_entry_valid(entry))
@@ -134,6 +135,12 @@ static inline void __list_del_entry(struct list_head *entry) · 2 unmodified lines
134135 __list_del(entry->prev, entry->next);
135136 }
136137
138+/**
139+ * list_del - deletes entry from list.
140+ * @entry: the element to delete from the list.
141+ * Note: list_empty() on entry does not return true after this, the entry is
142+ * in an undefined state.
143+ */
137144 static inline void list_del(struct list_head *entry)
138145 {
139146 __list_del_entry(entry);
@@ -157,8 +164,15 @@ static inline void list_replace(struct list_head *old, · 17 unmodified lines
157164 new->prev->next = new;
158165 }
159166
167+/**
168+ * list_replace_init - replace old entry by new one and initialize the old one
169+ * @old : the element to be replaced
170+ * @new : the new element to insert
171+ *
172+ * If @old was empty, it will be overwritten.
173+ */
160174 static inline void list_replace_init(struct list_head *old,
161− struct list_head *new)
175+ struct list_head *new)
162176 {
163177 list_replace(old, new);
164178 INIT_LIST_HEAD(old);
@@ -754,11 +768,36 @@ static inline void INIT_HLIST_NODE(struct hlist_node *h) · 589 unmodified lines
754768 h->pprev = NULL;
755769 }
756770
771+/**
772+ * hlist_unhashed - Has node been removed from list and reinitialized?
773+ * @h: Node to be checked
774+ *
775+ * Not that not all removal functions will leave a node in unhashed
776+ * state. For example, hlist_nulls_del_init_rcu() does leave the
777+ * node in unhashed state, but hlist_nulls_del() does not.
778+ */
757779 static inline int hlist_unhashed(const struct hlist_node *h)
758780 {
759781 return !h->pprev;
760782 }
761783
784+/**
785+ * hlist_unhashed_lockless - Version of hlist_unhashed for lockless use
786+ * @h: Node to be checked
787+ *
788+ * This variant of hlist_unhashed() must be used in lockless contexts
789+ * to avoid potential load-tearing. The READ_ONCE() is paired with the
790+ * various WRITE_ONCE() in hlist helpers that are defined below.
791+ */
792+static inline int hlist_unhashed_lockless(const struct hlist_node *h)
793+{
794+ return !READ_ONCE(h->pprev);
795+}
796+
797+/**
798+ * hlist_empty - Is the specified hlist_head structure an empty hlist?
799+ * @h: Structure to check.
800+ */
762801 static inline int hlist_empty(const struct hlist_head *h)
763802 {
764803 return !READ_ONCE(h->first);
@@ -771,9 +810,16 @@ static inline void __hlist_del(struct hlist_node *n) · 6 unmodified lines
771810
772811 WRITE_ONCE(*pprev, next);
773812 if (next)
774− next->pprev = pprev;
813+ WRITE_ONCE(next->pprev, pprev);
775814 }
776815
816+/**
817+ * hlist_del - Delete the specified hlist_node from its list
818+ * @n: Node to delete.
819+ *
820+ * Note that this function leaves the node in hashed state. Use
821+ * hlist_del_init() or similar instead to unhash @n.
822+ */
777823 static inline void hlist_del(struct hlist_node *n)
778824 {
779825 __hlist_del(n);
@@ -781,6 +827,12 @@ static inline void hlist_del(struct hlist_node *n) · 1 unmodified line
781827 n->pprev = LIST_POISON2;
782828 }
783829
830+/**
831+ * hlist_del_init - Delete the specified hlist_node from its list and initialize
832+ * @n: Node to delete.
833+ *
834+ * Note that this function leaves the node in unhashed state.
835+ */
784836 static inline void hlist_del_init(struct hlist_node *n)
785837 {
786838 if (!hlist_unhashed(n)) {
@@ -789,51 +841,83 @@ static inline void hlist_del_init(struct hlist_node *n) · 2 unmodified lines
789841 }
790842 }
791843
844+/**
845+ * hlist_add_head - add a new entry at the beginning of the hlist
846+ * @n: new entry to be added
847+ * @h: hlist head to add it after
848+ *
849+ * Insert a new entry after the specified head.
850+ * This is good for implementing stacks.
851+ */
792852 static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
793853 {
794854 struct hlist_node *first = h->first;
795− n->next = first;
855+ WRITE_ONCE(n->next, first);
796856 if (first)
797− first->pprev = &n->next;
857+ WRITE_ONCE(first->pprev, &n->next);
798858 WRITE_ONCE(h->first, n);
799− n->pprev = &h->first;
859+ WRITE_ONCE(n->pprev, &h->first);
800860 }
801861
802−/* next must be != NULL */
862+/**
863+ * hlist_add_before - add a new entry before the one specified
864+ * @n: new entry to be added
865+ * @next: hlist node to add it before, which must be non-NULL
866+ */
803867 static inline void hlist_add_before(struct hlist_node *n,
804− struct hlist_node *next)
868+ struct hlist_node *next)
805869 {
806− n->pprev = next->pprev;
807− n->next = next;
808− next->pprev = &n->next;
870+ WRITE_ONCE(n->pprev, next->pprev);
871+ WRITE_ONCE(n->next, next);
872+ WRITE_ONCE(next->pprev, &n->next);
809873 WRITE_ONCE(*(n->pprev), n);
810874 }
811875
876+/**
877+ * hlist_add_behing - add a new entry after the one specified
878+ * @n: new entry to be added
879+ * @prev: hlist node to add it after, which must be non-NULL
880+ */
812881 static inline void hlist_add_behind(struct hlist_node *n,
813882 struct hlist_node *prev)
814883 {
815− n->next = prev->next;
816− prev->next = n;
817− n->pprev = &prev->next;
884+ WRITE_ONCE(n->next, prev->next);
885+ WRITE_ONCE(prev->next, n);
886+ WRITE_ONCE(n->pprev, &prev->next);
818887
819888 if (n->next)
820− n->next->pprev = &n->next;
889+ WRITE_ONCE(n->next->pprev, &n->next);
821890 }
822891
823−/* after that we'll appear to be on some hlist and hlist_del will work */
892+/**
893+ * hlist_add_fake - create a fake hlist consisting of a single headless node
894+ * @n: Node to make a fake list out of
895+ *
896+ * This makes @n appear to be its own predecessor on a headless hlist.
897+ * The point of this is to allow things like hlist_del() to work correctly
898+ * in cases where there is no list.
899+ */
824900 static inline void hlist_add_fake(struct hlist_node *n)
825901 {
826902 n->pprev = &n->next;
827903 }
828904
905+/**
906+ * hlist_fake: Is this node a fake hlist?
907+ * @h: Node to check for being a self-referential fake hlist.
908+ */
829909 static inline bool hlist_fake(struct hlist_node *h)
830910 {
831911 return h->pprev == &h->next;
832912 }
833913
834−/*
914+/**
915+ * hlist_is_singular_node - is node the only element of the specified hlist?
916+ * @n: Node to check for singularity.
917+ * @h: Header for potentially singular list.
918+ *
835919 * Check whether the node is the only node of the head without
836− * accessing head:
920+ * accessing head, thus avoiding unnecessary cache misses.
837921 */
838922 static inline bool
839923 hlist_is_singular_node(struct hlist_node *n, struct hlist_head *h)
@@ -841,7 +925,11 @@ hlist_is_singular_node(struct hlist_node *n, struct hlist_head *h) · 1 unmodified line
841925 return !n->next && n->pprev == &h->first;
842926 }
843927
844−/*
928+/**
929+ * hlist_move_list - Move an hlist
930+ * @old: hlist_head for old list.
931+ * @new: hlist_head for new list.
932+ *
845933 * Move a list from one list head to another. Fixup the pprev
846934 * reference of the first entry if it exists.
847935 */
include/linux/list_nulls.h+26−4
@@ -56,11 +56,33 @@ static inline unsigned long get_nulls_value(const struct hlist_nulls_node *ptr) · 55 unmodified lines
5656 return ((unsigned long)ptr) >> 1;
5757 }
5858
59+/**
60+ * hlist_nulls_unhashed - Has node been removed and reinitialized?
61+ * @h: Node to be checked
62+ *
63+ * Not that not all removal functions will leave a node in unhashed state.
64+ * For example, hlist_del_init_rcu() leaves the node in unhashed state,
65+ * but hlist_nulls_del() does not.
66+ */
5967 static inline int hlist_nulls_unhashed(const struct hlist_nulls_node *h)
6068 {
6169 return !h->pprev;
6270 }
6371
72+/**
73+ * hlist_nulls_unhashed_lockless - Has node been removed and reinitialized?
74+ * @h: Node to be checked
75+ *
76+ * Not that not all removal functions will leave a node in unhashed state.
77+ * For example, hlist_del_init_rcu() leaves the node in unhashed state,
78+ * but hlist_nulls_del() does not. Unlike hlist_nulls_unhashed(), this
79+ * function may be used locklessly.
80+ */
81+static inline int hlist_nulls_unhashed_lockless(const struct hlist_nulls_node *h)
82+{
83+ return !READ_ONCE(h->pprev);
84+}
85+
6486 static inline int hlist_nulls_empty(const struct hlist_nulls_head *h)
6587 {
6688 return is_a_nulls(READ_ONCE(h->first));
@@ -72,10 +94,10 @@ static inline void hlist_nulls_add_head(struct hlist_nulls_node *n, · 5 unmodified lines
7294 struct hlist_nulls_node *first = h->first;
7395
7496 n->next = first;
75− n->pprev = &h->first;
97+ WRITE_ONCE(n->pprev, &h->first);
7698 h->first = n;
7799 if (!is_a_nulls(first))
78− first->pprev = &n->next;
100+ WRITE_ONCE(first->pprev, &n->next);
79101 }
80102
81103 static inline void __hlist_nulls_del(struct hlist_nulls_node *n)
@@ -85,13 +107,13 @@ static inline void __hlist_nulls_del(struct hlist_nulls_node *n) · 3 unmodified lines
85107
86108 WRITE_ONCE(*pprev, next);
87109 if (!is_a_nulls(next))
88− next->pprev = pprev;
110+ WRITE_ONCE(next->pprev, pprev);
89111 }
90112
91113 static inline void hlist_nulls_del(struct hlist_nulls_node *n)
92114 {
93115 __hlist_nulls_del(n);
94− n->pprev = LIST_POISON2;
116+ WRITE_ONCE(n->pprev, LIST_POISON2);
95117 }
96118
97119 /**
include/linux/rcu_segcblist.h+0−2
@@ -22,7 +22,6 @@ struct rcu_cblist { · 21 unmodified lines
2222 struct rcu_head *head;
2323 struct rcu_head **tail;
2424 long len;
25− long len_lazy;
2625 };
2726
2827 #define RCU_CBLIST_INITIALIZER(n) { .head = NULL, .tail = &n.head }
@@ -73,7 +72,6 @@ struct rcu_segcblist { · 44 unmodified lines
7372 #else
7473 long len;
7574 #endif
76− long len_lazy;
7775 u8 enabled;
7876 u8 offloaded;
7977 };
include/linux/rculist.h+24−14
@@ -40,6 +40,16 @@ static inline void INIT_LIST_HEAD_RCU(struct list_head *list) · 39 unmodified lines
4040 */
4141 #define list_next_rcu(list) (*((struct list_head __rcu **)(&(list)->next)))
4242
43+/**
44+ * list_tail_rcu - returns the prev pointer of the head of the list
45+ * @head: the head of the list
46+ *
47+ * Note: This should only be used with the list header, and even then
48+ * only if list_del() and similar primitives are not also used on the
49+ * list header.
50+ */
51+#define list_tail_rcu(head) (*((struct list_head __rcu **)(&(head)->prev)))
52+
4353 /*
4454 * Check during list traversal that we are within an RCU reader
4555 */
@@ -173,7 +183,7 @@ static inline void hlist_del_init_rcu(struct hlist_node *n) · 127 unmodified lines
173183 {
174184 if (!hlist_unhashed(n)) {
175185 __hlist_del(n);
176− n->pprev = NULL;
186+ WRITE_ONCE(n->pprev, NULL);
177187 }
178188 }
179189
@@ -361,7 +371,7 @@ static inline void list_splice_tail_init_rcu(struct list_head *list, · 181 unmodified lines
361371 * @pos: the type * to use as a loop cursor.
362372 * @head: the head for your list.
363373 * @member: the name of the list_head within the struct.
364− * @cond: optional lockdep expression if called from non-RCU protection.
374+ * @cond...: optional lockdep expression if called from non-RCU protection.
365375 *
366376 * This list-traversal primitive may safely run concurrently with
367377 * the _rcu list-mutation primitives such as list_add_rcu()
@@ -473,7 +483,7 @@ static inline void list_splice_tail_init_rcu(struct list_head *list, · 105 unmodified lines
473483 static inline void hlist_del_rcu(struct hlist_node *n)
474484 {
475485 __hlist_del(n);
476− n->pprev = LIST_POISON2;
486+ WRITE_ONCE(n->pprev, LIST_POISON2);
477487 }
478488
479489 /**
@@ -489,11 +499,11 @@ static inline void hlist_replace_rcu(struct hlist_node *old, · 9 unmodified lines
489499 struct hlist_node *next = old->next;
490500
491501 new->next = next;
492− new->pprev = old->pprev;
502+ WRITE_ONCE(new->pprev, old->pprev);
493503 rcu_assign_pointer(*(struct hlist_node __rcu **)new->pprev, new);
494504 if (next)
495− new->next->pprev = &new->next;
496− old->pprev = LIST_POISON2;
505+ WRITE_ONCE(new->next->pprev, &new->next);
506+ WRITE_ONCE(old->pprev, LIST_POISON2);
497507 }
498508
499509 /*
@@ -528,10 +538,10 @@ static inline void hlist_add_head_rcu(struct hlist_node *n, · 28 unmodified lines
528538 struct hlist_node *first = h->first;
529539
530540 n->next = first;
531− n->pprev = &h->first;
541+ WRITE_ONCE(n->pprev, &h->first);
532542 rcu_assign_pointer(hlist_first_rcu(h), n);
533543 if (first)
534− first->pprev = &n->next;
544+ WRITE_ONCE(first->pprev, &n->next);
535545 }
536546
537547 /**
@@ -564,7 +574,7 @@ static inline void hlist_add_tail_rcu(struct hlist_node *n, · 26 unmodified lines
564574
565575 if (last) {
566576 n->next = last->next;
567− n->pprev = &last->next;
577+ WRITE_ONCE(n->pprev, &last->next);
568578 rcu_assign_pointer(hlist_next_rcu(last), n);
569579 } else {
570580 hlist_add_head_rcu(n, h);
@@ -592,10 +602,10 @@ static inline void hlist_add_tail_rcu(struct hlist_node *n, · 21 unmodified lines
592602 static inline void hlist_add_before_rcu(struct hlist_node *n,
593603 struct hlist_node *next)
594604 {
595− n->pprev = next->pprev;
605+ WRITE_ONCE(n->pprev, next->pprev);
596606 n->next = next;
597607 rcu_assign_pointer(hlist_pprev_rcu(n), n);
598− next->pprev = &n->next;
608+ WRITE_ONCE(next->pprev, &n->next);
599609 }
600610
601611 /**
@@ -620,10 +630,10 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, · 18 unmodified lines
620630 struct hlist_node *prev)
621631 {
622632 n->next = prev->next;
623− n->pprev = &prev->next;
633+ WRITE_ONCE(n->pprev, &prev->next);
624634 rcu_assign_pointer(hlist_next_rcu(prev), n);
625635 if (n->next)
626− n->next->pprev = &n->next;
636+ WRITE_ONCE(n->next->pprev, &n->next);
627637 }
628638
629639 #define __hlist_for_each_rcu(pos, head) \
@@ -636,7 +646,7 @@ static inline void hlist_add_behind_rcu(struct hlist_node *n, · 6 unmodified lines
636646 * @pos: the type * to use as a loop cursor.
637647 * @head: the head for your list.
638648 * @member: the name of the hlist_node within the struct.
639− * @cond: optional lockdep expression if called from non-RCU protection.
649+ * @cond...: optional lockdep expression if called from non-RCU protection.
640650 *
641651 * This list-traversal primitive may safely run concurrently with
642652 * the _rcu list-mutation primitives such as hlist_add_head_rcu()
include/linux/rculist_nulls.h+14−6
@@ -34,13 +34,21 @@ static inline void hlist_nulls_del_init_rcu(struct hlist_nulls_node *n) · 33 unmodified lines
3434 {
3535 if (!hlist_nulls_unhashed(n)) {
3636 __hlist_nulls_del(n);
37− n->pprev = NULL;
37+ WRITE_ONCE(n->pprev, NULL);
3838 }
3939 }
4040
41+/**
42+ * hlist_nulls_first_rcu - returns the first element of the hash list.
43+ * @head: the head of the list.
44+ */
4145 #define hlist_nulls_first_rcu(head) \
4246 (*((struct hlist_nulls_node __rcu __force **)&(head)->first))
4347
48+/**
49+ * hlist_nulls_next_rcu - returns the element of the list after @node.
50+ * @node: element of the list.
51+ */
4452 #define hlist_nulls_next_rcu(node) \
4553 (*((struct hlist_nulls_node __rcu __force **)&(node)->next))
4654
@@ -66,7 +74,7 @@ static inline void hlist_nulls_del_init_rcu(struct hlist_nulls_node *n) · 19 unmodified lines
6674 static inline void hlist_nulls_del_rcu(struct hlist_nulls_node *n)
6775 {
6876 __hlist_nulls_del(n);
69− n->pprev = LIST_POISON2;
77+ WRITE_ONCE(n->pprev, LIST_POISON2);
7078 }
7179
7280 /**
@@ -94,10 +102,10 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, · 21 unmodified lines
94102 struct hlist_nulls_node *first = h->first;
95103
96104 n->next = first;
97− n->pprev = &h->first;
105+ WRITE_ONCE(n->pprev, &h->first);
98106 rcu_assign_pointer(hlist_nulls_first_rcu(h), n);
99107 if (!is_a_nulls(first))
100− first->pprev = &n->next;
108+ WRITE_ONCE(first->pprev, &n->next);
101109 }
102110
103111 /**
@@ -141,7 +149,7 @@ static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n, · 37 unmodified lines
141149 * hlist_nulls_for_each_entry_rcu - iterate over rcu list of given type
142150 * @tpos: the type * to use as a loop cursor.
143151 * @pos: the &struct hlist_nulls_node to use as a loop cursor.
144− * @head: the head for your list.
152+ * @head: the head of the list.
145153 * @member: the name of the hlist_nulls_node within the struct.
146154 *
147155 * The barrier() is needed to make sure compiler doesn't cache first element [1],
@@ -161,7 +169,7 @@ static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n, · 13 unmodified lines
161169 * iterate over list of given type safe against removal of list entry
162170 * @tpos: the type * to use as a loop cursor.
163171 * @pos: the &struct hlist_nulls_node to use as a loop cursor.
164− * @head: the head for your list.
172+ * @head: the head of the list.
165173 * @member: the name of the hlist_nulls_node within the struct.
166174 */
167175 #define hlist_nulls_for_each_entry_safe(tpos, pos, head, member) \
include/linux/rcupdate.h+8−20
@@ -154,7 +154,7 @@ static inline void exit_tasks_rcu_finish(void) { } · 153 unmodified lines
154154 *
155155 * This macro resembles cond_resched(), except that it is defined to
156156 * report potential quiescent states to RCU-tasks even if the cond_resched()
157− * machinery were to be shut off, as some advocate for PREEMPT kernels.
157+ * machinery were to be shut off, as some advocate for PREEMPTION kernels.
158158 */
159159 #define cond_resched_tasks_rcu_qs() \
160160 do { \
@@ -167,7 +167,7 @@ do { \ · 6 unmodified lines
167167 * TREE_RCU and rcu_barrier_() primitives in TINY_RCU.
168168 */
169169
170−#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
170+#if defined(CONFIG_TREE_RCU)
171171 #include <linux/rcutree.h>
172172 #elif defined(CONFIG_TINY_RCU)
173173 #include <linux/rcutiny.h>
@@ -400,22 +400,6 @@ do { \ · 226 unmodified lines
400400 __tmp; \
401401 })
402402
403−/**
404− * rcu_swap_protected() - swap an RCU and a regular pointer
405− * @rcu_ptr: RCU pointer
406− * @ptr: regular pointer
407− * @c: the conditions under which the dereference will take place
408− *
409− * Perform swap(@rcu_ptr, @ptr) where @rcu_ptr is an RCU-annotated pointer and
410− * @c is the argument that is passed to the rcu_dereference_protected() call
411− * used to read that pointer.
412− */
413−#define rcu_swap_protected(rcu_ptr, ptr, c) do { \
414− typeof(ptr) __tmp = rcu_dereference_protected((rcu_ptr), (c)); \
415− rcu_assign_pointer((rcu_ptr), (ptr)); \
416− (ptr) = __tmp; \
417−} while (0)
418−
419403 /**
420404 * rcu_access_pointer() - fetch RCU pointer with no dereferencing
421405 * @p: The pointer to read
@@ -598,10 +582,10 @@ do { \ · 176 unmodified lines
598582 *
599583 * You can avoid reading and understanding the next paragraph by
600584 * following this rule: don't put anything in an rcu_read_lock() RCU
601− * read-side critical section that would block in a !PREEMPT kernel.
585+ * read-side critical section that would block in a !PREEMPTION kernel.
602586 * But if you want the full story, read on!
603587 *
604− * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU),
588+ * In non-preemptible RCU implementations (pure TREE_RCU and TINY_RCU),
605589 * it is illegal to block while in an RCU read-side critical section.
606590 * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPTION
607591 * kernel builds, RCU read-side critical sections may be preempted,
@@ -912,4 +896,8 @@ rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t f) · 304 unmodified lines
912896 return false;
913897 }
914898
899+/* kernel/ksysfs.c definitions */
900+extern int rcu_expedited;
901+extern int rcu_normal;
902+
915903 #endif /* __LINUX_RCUPDATE_H */
include/linux/rcutiny.h+1−0
@@ -85,6 +85,7 @@ static inline void rcu_scheduler_starting(void) { } · 84 unmodified lines
8585 static inline void rcu_end_inkernel_boot(void) { }
8686 static inline bool rcu_is_watching(void) { return true; }
8787 static inline void rcu_momentary_dyntick_idle(void) { }
88+static inline void kfree_rcu_scheduler_running(void) { }
8889
8990 /* Avoid RCU read-side critical sections leaking across. */
9091 static inline void rcu_all_qs(void) { barrier(); }
include/linux/rcutree.h+1−0
@@ -38,6 +38,7 @@ void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func); · 37 unmodified lines
3838 void rcu_barrier(void);
3939 bool rcu_eqs_special_set(int cpu);
4040 void rcu_momentary_dyntick_idle(void);
41+void kfree_rcu_scheduler_running(void);
4142 unsigned long get_state_synchronize_rcu(void);
4243 void cond_synchronize_rcu(unsigned long oldstate);
4344
include/linux/tick.h+4−1
@@ -109,8 +109,10 @@ enum tick_dep_bits { · 108 unmodified lines
109109 TICK_DEP_BIT_PERF_EVENTS = 1,
110110 TICK_DEP_BIT_SCHED = 2,
111111 TICK_DEP_BIT_CLOCK_UNSTABLE = 3,
112− TICK_DEP_BIT_RCU = 4
112+ TICK_DEP_BIT_RCU = 4,
113+ TICK_DEP_BIT_RCU_EXP = 5
113114 };
115+#define TICK_DEP_BIT_MAX TICK_DEP_BIT_RCU_EXP
114116
115117 #define TICK_DEP_MASK_NONE 0
116118 #define TICK_DEP_MASK_POSIX_TIMER (1 << TICK_DEP_BIT_POSIX_TIMER)
@@ -118,6 +120,7 @@ enum tick_dep_bits { · 1 unmodified line
118120 #define TICK_DEP_MASK_SCHED (1 << TICK_DEP_BIT_SCHED)
119121 #define TICK_DEP_MASK_CLOCK_UNSTABLE (1 << TICK_DEP_BIT_CLOCK_UNSTABLE)
120122 #define TICK_DEP_MASK_RCU (1 << TICK_DEP_BIT_RCU)
123+#define TICK_DEP_MASK_RCU_EXP (1 << TICK_DEP_BIT_RCU_EXP)
121124
122125 #ifdef CONFIG_NO_HZ_COMMON
123126 extern bool tick_nohz_enabled;