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 main RCU related changes in this cycle were: - Additional cleanups after RCU flavor consolidation - Grace-period forward-progress cleanups and improvements - Documentation updates - Miscellaneous fixes - spin_is_locked() conversions to lockdep - SPDX changes to RCU source and header files - SRCU updates - Torture-test updates, including nolibc updates and moving nolibc to tools/include" * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits) locking/locktorture: Convert to SPDX license identifier linux/torture: Convert to SPDX license identifier torture: Convert to SPDX license identifier linux/srcu: Convert to SPDX license identifier linux/rcutree: Convert to SPDX license identifier linux/rcutiny: Convert to SPDX license identifier linux/rcu_sync: Convert to SPDX license identifier linux/rcu_segcblist: Convert to SPDX license identifier linux/rcupdate: Convert to SPDX license identifier linux/rcu_node_tree: Convert to SPDX license identifier rcu/update: Convert to SPDX license identifier rcu/tree: Convert to SPDX license identifier rcu/tiny: Convert to SPDX license identifier rcu/sync: Convert to SPDX license identifier rcu/srcu: Convert to SPDX license identifier rcu/rcutorture: Convert to SPDX license identifier rcu/rcu_segcblist: Convert to SPDX license identifier rcu/rcuperf: Convert to SPDX license identifier rcu/rcu.h: Convert to SPDX license identifier RCU/torture.txt: Remove section MODULE PARAMETERS ...

Linus Torvalds committed 7 years ago

Commit 3717f612 parents b1b988a cae45e163 files · +1395 −1268Browse files

Showing the changes to include/linux (10 of 63 files). Show all

Unified · Split

10 files
  1. include/linux/rcu_node_tree.h +2 −15
  2. include/linux/rcu_segcblist.h +2 −15
  3. include/linux/rcu_sync.h +1 −14
  4. include/linux/rcupdate.h +13 −78
  5. include/linux/rcutiny.h +2 −15
  6. include/linux/rcutree.h +3 −16
  7. include/linux/srcu.h +3 −15
  8. include/linux/srcutiny.h +2 −15
  9. include/linux/srcutree.h +4 −16
  10. include/linux/torture.h +4 −16
include/linux/rcu_node_tree.h+2−15
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * RCU node combining tree definitions. These are used to compute
34 * global attributes while avoiding common-case global contention. A key
@@ -11,23 +12,9 @@ · 7 unmodified lines
1112 * because the size of the TREE SRCU srcu_struct structure depends
1213 * on these definitions.
1314 *
14− * This program is free software; you can redistribute it and/or modify
15− * it under the terms of the GNU General Public License as published by
16− * the Free Software Foundation; either version 2 of the License, or
17− * (at your option) any later version.
18− *
19− * This program is distributed in the hope that it will be useful,
20− * but WITHOUT ANY WARRANTY; without even the implied warranty of
21− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22− * GNU General Public License for more details.
23− *
24− * You should have received a copy of the GNU General Public License
25− * along with this program; if not, you can access it online at
26− * http://www.gnu.org/licenses/gpl-2.0.html.
27− *
2815 * Copyright IBM Corporation, 2017
2916 *
30− * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
17+ * Author: Paul E. McKenney <paulmck@linux.ibm.com>
3118 */
3219
3320 #ifndef __LINUX_RCU_NODE_TREE_H
include/linux/rcu_segcblist.h+2−15
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * RCU segmented callback lists
34 *
@@ -5,23 +6,9 @@ · 1 unmodified line
56 * because the size of the TREE SRCU srcu_struct structure depends
67 * on these definitions.
78 *
8− * This program is free software; you can redistribute it and/or modify
9− * it under the terms of the GNU General Public License as published by
10− * the Free Software Foundation; either version 2 of the License, or
11− * (at your option) any later version.
12− *
13− * This program is distributed in the hope that it will be useful,
14− * but WITHOUT ANY WARRANTY; without even the implied warranty of
15− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16− * GNU General Public License for more details.
17− *
18− * You should have received a copy of the GNU General Public License
19− * along with this program; if not, you can access it online at
20− * http://www.gnu.org/licenses/gpl-2.0.html.
21− *
229 * Copyright IBM Corporation, 2017
2310 *
24− * Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
11+ * Authors: Paul E. McKenney <paulmck@linux.net.ibm.com>
2512 */
2613
2714 #ifndef __INCLUDE_LINUX_RCU_SEGCBLIST_H
include/linux/rcu_sync.h+1−14
@@ -1,20 +1,7 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * RCU-based infrastructure for lightweight reader-writer locking
34 *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; either version 2 of the License, or
7− * (at your option) any later version.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public License
15− * along with this program; if not, you can access it online at
16− * http://www.gnu.org/licenses/gpl-2.0.html.
17− *
185 * Copyright (c) 2015, Red Hat, Inc.
196 *
207 * Author: Oleg Nesterov <oleg@redhat.com>
include/linux/rcupdate.h+13−78
@@ -1,25 +1,12 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Read-Copy Update mechanism for mutual exclusion
34 *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; either version 2 of the License, or
7− * (at your option) any later version.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public License
15− * along with this program; if not, you can access it online at
16− * http://www.gnu.org/licenses/gpl-2.0.html.
17− *
185 * Copyright IBM Corporation, 2001
196 *
207 * Author: Dipankar Sarma <dipankar@in.ibm.com>
218 *
22− * Based on the original work by Paul McKenney <paulmck@us.ibm.com>
9+ * Based on the original work by Paul McKenney <paulmck@vnet.ibm.com>
2310 * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
2411 * Papers:
2512 * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf
@@ -89,7 +76,7 @@ static inline int rcu_preempt_depth(void) · 63 unmodified lines
8976 /* Internal to kernel */
9077 void rcu_init(void);
9178 extern int rcu_scheduler_active __read_mostly;
92−void rcu_check_callbacks(int user);
79+void rcu_sched_clock_irq(int user);
9380 void rcu_report_dead(unsigned int cpu);
9481 void rcutree_migrate_callbacks(int cpu);
9582
@@ -309,16 +296,16 @@ static inline void rcu_preempt_sleep_check(void) { } · 213 unmodified lines
309296 */
310297
311298 #ifdef __CHECKER__
312−#define rcu_dereference_sparse(p, space) \
299+#define rcu_check_sparse(p, space) \
313300 ((void)(((typeof(*p) space *)p) == p))
314301 #else /* #ifdef __CHECKER__ */
315−#define rcu_dereference_sparse(p, space)
302+#define rcu_check_sparse(p, space)
316303 #endif /* #else #ifdef __CHECKER__ */
317304
318305 #define __rcu_access_pointer(p, space) \
319306 ({ \
320307 typeof(*p) *_________p1 = (typeof(*p) *__force)READ_ONCE(p); \
321− rcu_dereference_sparse(p, space); \
308+ rcu_check_sparse(p, space); \
322309 ((typeof(*p) __force __kernel *)(_________p1)); \
323310 })
324311 #define __rcu_dereference_check(p, c, space) \
@@ -326,13 +313,13 @@ static inline void rcu_preempt_sleep_check(void) { } · 1 unmodified line
326313 /* Dependency order vs. p above. */ \
327314 typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
328315 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \
329− rcu_dereference_sparse(p, space); \
316+ rcu_check_sparse(p, space); \
330317 ((typeof(*p) __force __kernel *)(________p1)); \
331318 })
332319 #define __rcu_dereference_protected(p, c, space) \
333320 ({ \
334321 RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \
335− rcu_dereference_sparse(p, space); \
322+ rcu_check_sparse(p, space); \
336323 ((typeof(*p) __force __kernel *)(p)); \
337324 })
338325 #define rcu_dereference_raw(p) \
@@ -382,6 +369,7 @@ static inline void rcu_preempt_sleep_check(void) { } · 43 unmodified lines
382369 #define rcu_assign_pointer(p, v) \
383370 ({ \
384371 uintptr_t _r_a_p__v = (uintptr_t)(v); \
372+ rcu_check_sparse(p, __rcu); \
385373 \
386374 if (__builtin_constant_p(v) && (_r_a_p__v) == (uintptr_t)NULL) \
387375 WRITE_ONCE((p), (typeof(p))(_r_a_p__v)); \
@@ -785,7 +773,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) · 397 unmodified lines
785773 */
786774 #define RCU_INIT_POINTER(p, v) \
787775 do { \
788− rcu_dereference_sparse(p, __rcu); \
776+ rcu_check_sparse(p, __rcu); \
789777 WRITE_ONCE(p, RCU_INITIALIZER(v)); \
790778 } while (0)
791779
@@ -859,7 +847,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) · 67 unmodified lines
859847
860848 /* Has the specified rcu_head structure been handed to call_rcu()? */
861849
862−/*
850+/**
863851 * rcu_head_init - Initialize rcu_head for rcu_head_after_call_rcu()
864852 * @rhp: The rcu_head structure to initialize.
865853 *
@@ -874,10 +862,10 @@ static inline void rcu_head_init(struct rcu_head *rhp) · 8 unmodified lines
874862 rhp->func = (rcu_callback_t)~0L;
875863 }
876864
877−/*
865+/**
878866 * rcu_head_after_call_rcu - Has this rcu_head been passed to call_rcu()?
879867 * @rhp: The rcu_head structure to test.
880− * @func: The function passed to call_rcu() along with @rhp.
868+ * @f: The function passed to call_rcu() along with @rhp.
881869 *
882870 * Returns @true if the @rhp has been passed to call_rcu() with @func,
883871 * and @false otherwise. Emits a warning in any other case, including
@@ -896,57 +884,4 @@ rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t f) · 12 unmodified lines
896884 return false;
897885 }
898886
899−
900−/* Transitional pre-consolidation compatibility definitions. */
901−
902−static inline void synchronize_rcu_bh(void)
903−{
904− synchronize_rcu();
905−}
906−
907−static inline void synchronize_rcu_bh_expedited(void)
908−{
909− synchronize_rcu_expedited();
910−}
911−
912−static inline void call_rcu_bh(struct rcu_head *head, rcu_callback_t func)
913−{
914− call_rcu(head, func);
915−}
916−
917−static inline void rcu_barrier_bh(void)
918−{
919− rcu_barrier();
920−}
921−
922−static inline void synchronize_sched(void)
923−{
924− synchronize_rcu();
925−}
926−
927−static inline void synchronize_sched_expedited(void)
928−{
929− synchronize_rcu_expedited();
930−}
931−
932−static inline void call_rcu_sched(struct rcu_head *head, rcu_callback_t func)
933−{
934− call_rcu(head, func);
935−}
936−
937−static inline void rcu_barrier_sched(void)
938−{
939− rcu_barrier();
940−}
941−
942−static inline unsigned long get_state_synchronize_sched(void)
943−{
944− return get_state_synchronize_rcu();
945−}
946−
947−static inline void cond_synchronize_sched(unsigned long oldstate)
948−{
949− cond_synchronize_rcu(oldstate);
950−}
951−
952887 #endif /* __LINUX_RCUPDATE_H */
include/linux/rcutiny.h+2−15
@@ -1,23 +1,10 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition.
34 *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; either version 2 of the License, or
7− * (at your option) any later version.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public License
15− * along with this program; if not, you can access it online at
16− * http://www.gnu.org/licenses/gpl-2.0.html.
17− *
185 * Copyright IBM Corporation, 2008
196 *
20− * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
7+ * Author: Paul E. McKenney <paulmck@linux.ibm.com>
218 *
229 * For detailed explanation of Read-Copy Update mechanism see -
2310 * Documentation/RCU
include/linux/rcutree.h+3−16
@@ -1,26 +1,13 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Read-Copy Update mechanism for mutual exclusion (tree-based version)
34 *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; either version 2 of the License, or
7− * (at your option) any later version.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public License
15− * along with this program; if not, you can access it online at
16− * http://www.gnu.org/licenses/gpl-2.0.html.
17− *
185 * Copyright IBM Corporation, 2008
196 *
207 * Author: Dipankar Sarma <dipankar@in.ibm.com>
21− * Paul E. McKenney <paulmck@linux.vnet.ibm.com> Hierarchical algorithm
8+ * Paul E. McKenney <paulmck@linux.ibm.com> Hierarchical algorithm
229 *
23− * Based on the original work by Paul McKenney <paulmck@us.ibm.com>
10+ * Based on the original work by Paul McKenney <paulmck@linux.ibm.com>
2411 * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen.
2512 *
2613 * For detailed explanation of Read-Copy Update mechanism see -
include/linux/srcu.h+3−15
@@ -1,24 +1,11 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Sleepable Read-Copy Update mechanism for mutual exclusion
34 *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; either version 2 of the License, or
7− * (at your option) any later version.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public License
15− * along with this program; if not, you can access it online at
16− * http://www.gnu.org/licenses/gpl-2.0.html.
17− *
185 * Copyright (C) IBM Corporation, 2006
196 * Copyright (C) Fujitsu, 2012
207 *
21− * Author: Paul McKenney <paulmck@us.ibm.com>
8+ * Author: Paul McKenney <paulmck@linux.ibm.com>
229 * Lai Jiangshan <laijs@cn.fujitsu.com>
2310 *
2411 * For detailed explanation of Read-Copy Update mechanism see -
@@ -223,6 +210,7 @@ srcu_read_lock_notrace(struct srcu_struct *ssp) __acquires(ssp) · 198 unmodified lines
223210 static inline void srcu_read_unlock(struct srcu_struct *ssp, int idx)
224211 __releases(ssp)
225212 {
213+ WARN_ON_ONCE(idx & ~0x1);
226214 rcu_lock_release(&(ssp)->dep_map);
227215 __srcu_read_unlock(ssp, idx);
228216 }
include/linux/srcutiny.h+2−15
@@ -1,24 +1,11 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Sleepable Read-Copy Update mechanism for mutual exclusion,
34 * tiny variant.
45 *
5− * This program is free software; you can redistribute it and/or modify
6− * it under the terms of the GNU General Public License as published by
7− * the Free Software Foundation; either version 2 of the License, or
8− * (at your option) any later version.
9− *
10− * This program is distributed in the hope that it will be useful,
11− * but WITHOUT ANY WARRANTY; without even the implied warranty of
12− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13− * GNU General Public License for more details.
14− *
15− * You should have received a copy of the GNU General Public License
16− * along with this program; if not, you can access it online at
17− * http://www.gnu.org/licenses/gpl-2.0.html.
18− *
196 * Copyright (C) IBM Corporation, 2017
207 *
21− * Author: Paul McKenney <paulmck@us.ibm.com>
8+ * Author: Paul McKenney <paulmck@linux.ibm.com>
229 */
2310
2411 #ifndef _LINUX_SRCU_TINY_H
include/linux/srcutree.h+4−16
@@ -1,24 +1,11 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Sleepable Read-Copy Update mechanism for mutual exclusion,
34 * tree variant.
45 *
5− * This program is free software; you can redistribute it and/or modify
6− * it under the terms of the GNU General Public License as published by
7− * the Free Software Foundation; either version 2 of the License, or
8− * (at your option) any later version.
9− *
10− * This program is distributed in the hope that it will be useful,
11− * but WITHOUT ANY WARRANTY; without even the implied warranty of
12− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13− * GNU General Public License for more details.
14− *
15− * You should have received a copy of the GNU General Public License
16− * along with this program; if not, you can access it online at
17− * http://www.gnu.org/licenses/gpl-2.0.html.
18− *
196 * Copyright (C) IBM Corporation, 2017
207 *
21− * Author: Paul McKenney <paulmck@us.ibm.com>
8+ * Author: Paul McKenney <paulmck@linux.ibm.com>
229 */
2310
2411 #ifndef _LINUX_SRCU_TREE_H
@@ -45,7 +32,8 @@ struct srcu_data { · 20 unmodified lines
4532 unsigned long srcu_gp_seq_needed; /* Furthest future GP needed. */
4633 unsigned long srcu_gp_seq_needed_exp; /* Furthest future exp GP. */
4734 bool srcu_cblist_invoking; /* Invoking these CBs? */
48− struct delayed_work work; /* Context for CB invoking. */
35+ struct timer_list delay_work; /* Delay for CB invoking */
36+ struct work_struct work; /* Context for CB invoking. */
4937 struct rcu_head srcu_barrier_head; /* For srcu_barrier() use. */
5038 struct srcu_node *mynode; /* Leaf srcu_node. */
5139 unsigned long grpmask; /* Mask for leaf srcu_node */
include/linux/torture.h+4−16
@@ -1,23 +1,10 @@
1+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * Common functions for in-kernel torture tests.
34 *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; either version 2 of the License, or
7− * (at your option) any later version.
8− *
9− * This program is distributed in the hope that it will be useful,
10− * but WITHOUT ANY WARRANTY; without even the implied warranty of
11− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12− * GNU General Public License for more details.
13− *
14− * You should have received a copy of the GNU General Public License
15− * along with this program; if not, you can access it online at
16− * http://www.gnu.org/licenses/gpl-2.0.html.
17− *
185 * Copyright IBM Corporation, 2014
196 *
20− * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
7+ * Author: Paul E. McKenney <paulmck@linux.ibm.com>
218 */
229
2310 #ifndef __LINUX_TORTURE_H
@@ -50,11 +37,12 @@ · 26 unmodified lines
5037 do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); } while (0)
5138
5239 /* Definitions for online/offline exerciser. */
40+typedef void torture_ofl_func(void);
5341 bool torture_offline(int cpu, long *n_onl_attempts, long *n_onl_successes,
5442 unsigned long *sum_offl, int *min_onl, int *max_onl);
5543 bool torture_online(int cpu, long *n_onl_attempts, long *n_onl_successes,
5644 unsigned long *sum_onl, int *min_onl, int *max_onl);
57−int torture_onoff_init(long ooholdoff, long oointerval);
45+int torture_onoff_init(long ooholdoff, long oointerval, torture_ofl_func *f);
5846 void torture_onoff_stats(void);
5947 bool torture_onoff_failures(void);
6048

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t