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 ...
Showing the changes to include/linux (10 of 63 files). Show all
Unified · Split
| @@ -1,3 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * RCU node combining tree definitions. These are used to compute | 3 | * RCU node combining tree definitions. These are used to compute |
| 3 | * global attributes while avoiding common-case global contention. A key | 4 | * global attributes while avoiding common-case global contention. A key |
| @@ -11,23 +12,9 @@ · 7 unmodified lines | |||
| 11 | * because the size of the TREE SRCU srcu_struct structure depends | 12 | * because the size of the TREE SRCU srcu_struct structure depends |
| 12 | * on these definitions. | 13 | * on these definitions. |
| 13 | * | 14 | * |
| 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 | * | ||
| 28 | * Copyright IBM Corporation, 2017 | 15 | * Copyright IBM Corporation, 2017 |
| 29 | * | 16 | * |
| 30 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 17 | * Author: Paul E. McKenney <paulmck@linux.ibm.com> |
| 31 | */ | 18 | */ |
| 32 | 19 | ||
| 33 | #ifndef __LINUX_RCU_NODE_TREE_H | 20 | #ifndef __LINUX_RCU_NODE_TREE_H |
| @@ -1,3 +1,4 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * RCU segmented callback lists | 3 | * RCU segmented callback lists |
| 3 | * | 4 | * |
| @@ -5,23 +6,9 @@ · 1 unmodified line | |||
| 5 | * because the size of the TREE SRCU srcu_struct structure depends | 6 | * because the size of the TREE SRCU srcu_struct structure depends |
| 6 | * on these definitions. | 7 | * on these definitions. |
| 7 | * | 8 | * |
| 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 | * | ||
| 22 | * Copyright IBM Corporation, 2017 | 9 | * Copyright IBM Corporation, 2017 |
| 23 | * | 10 | * |
| 24 | * Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 11 | * Authors: Paul E. McKenney <paulmck@linux.net.ibm.com> |
| 25 | */ | 12 | */ |
| 26 | 13 | ||
| 27 | #ifndef __INCLUDE_LINUX_RCU_SEGCBLIST_H | 14 | #ifndef __INCLUDE_LINUX_RCU_SEGCBLIST_H |
| @@ -1,20 +1,7 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * RCU-based infrastructure for lightweight reader-writer locking | 3 | * RCU-based infrastructure for lightweight reader-writer locking |
| 3 | * | 4 | * |
| 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 | * | ||
| 18 | * Copyright (c) 2015, Red Hat, Inc. | 5 | * Copyright (c) 2015, Red Hat, Inc. |
| 19 | * | 6 | * |
| 20 | * Author: Oleg Nesterov <oleg@redhat.com> | 7 | * Author: Oleg Nesterov <oleg@redhat.com> |
| @@ -1,25 +1,12 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * Read-Copy Update mechanism for mutual exclusion | 3 | * Read-Copy Update mechanism for mutual exclusion |
| 3 | * | 4 | * |
| 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 | * | ||
| 18 | * Copyright IBM Corporation, 2001 | 5 | * Copyright IBM Corporation, 2001 |
| 19 | * | 6 | * |
| 20 | * Author: Dipankar Sarma <dipankar@in.ibm.com> | 7 | * Author: Dipankar Sarma <dipankar@in.ibm.com> |
| 21 | * | 8 | * |
| 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> |
| 23 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. | 10 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. |
| 24 | * Papers: | 11 | * Papers: |
| 25 | * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf | 12 | * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf |
| @@ -89,7 +76,7 @@ static inline int rcu_preempt_depth(void) · 63 unmodified lines | |||
| 89 | /* Internal to kernel */ | 76 | /* Internal to kernel */ |
| 90 | void rcu_init(void); | 77 | void rcu_init(void); |
| 91 | extern int rcu_scheduler_active __read_mostly; | 78 | extern int rcu_scheduler_active __read_mostly; |
| 92 | void rcu_check_callbacks(int user); | 79 | void rcu_sched_clock_irq(int user); |
| 93 | void rcu_report_dead(unsigned int cpu); | 80 | void rcu_report_dead(unsigned int cpu); |
| 94 | void rcutree_migrate_callbacks(int cpu); | 81 | void rcutree_migrate_callbacks(int cpu); |
| 95 | 82 | ||
| @@ -309,16 +296,16 @@ static inline void rcu_preempt_sleep_check(void) { } · 213 unmodified lines | |||
| 309 | */ | 296 | */ |
| 310 | 297 | ||
| 311 | #ifdef __CHECKER__ | 298 | #ifdef __CHECKER__ |
| 312 | #define rcu_dereference_sparse(p, space) \ | 299 | #define rcu_check_sparse(p, space) \ |
| 313 | ((void)(((typeof(*p) space *)p) == p)) | 300 | ((void)(((typeof(*p) space *)p) == p)) |
| 314 | #else /* #ifdef __CHECKER__ */ | 301 | #else /* #ifdef __CHECKER__ */ |
| 315 | #define rcu_dereference_sparse(p, space) | 302 | #define rcu_check_sparse(p, space) |
| 316 | #endif /* #else #ifdef __CHECKER__ */ | 303 | #endif /* #else #ifdef __CHECKER__ */ |
| 317 | 304 | ||
| 318 | #define __rcu_access_pointer(p, space) \ | 305 | #define __rcu_access_pointer(p, space) \ |
| 319 | ({ \ | 306 | ({ \ |
| 320 | typeof(*p) *_________p1 = (typeof(*p) *__force)READ_ONCE(p); \ | 307 | typeof(*p) *_________p1 = (typeof(*p) *__force)READ_ONCE(p); \ |
| 321 | rcu_dereference_sparse(p, space); \ | 308 | rcu_check_sparse(p, space); \ |
| 322 | ((typeof(*p) __force __kernel *)(_________p1)); \ | 309 | ((typeof(*p) __force __kernel *)(_________p1)); \ |
| 323 | }) | 310 | }) |
| 324 | #define __rcu_dereference_check(p, c, space) \ | 311 | #define __rcu_dereference_check(p, c, space) \ |
| @@ -326,13 +313,13 @@ static inline void rcu_preempt_sleep_check(void) { } · 1 unmodified line | |||
| 326 | /* Dependency order vs. p above. */ \ | 313 | /* Dependency order vs. p above. */ \ |
| 327 | typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \ | 314 | typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \ |
| 328 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \ | 315 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_check() usage"); \ |
| 329 | rcu_dereference_sparse(p, space); \ | 316 | rcu_check_sparse(p, space); \ |
| 330 | ((typeof(*p) __force __kernel *)(________p1)); \ | 317 | ((typeof(*p) __force __kernel *)(________p1)); \ |
| 331 | }) | 318 | }) |
| 332 | #define __rcu_dereference_protected(p, c, space) \ | 319 | #define __rcu_dereference_protected(p, c, space) \ |
| 333 | ({ \ | 320 | ({ \ |
| 334 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \ | 321 | RCU_LOCKDEP_WARN(!(c), "suspicious rcu_dereference_protected() usage"); \ |
| 335 | rcu_dereference_sparse(p, space); \ | 322 | rcu_check_sparse(p, space); \ |
| 336 | ((typeof(*p) __force __kernel *)(p)); \ | 323 | ((typeof(*p) __force __kernel *)(p)); \ |
| 337 | }) | 324 | }) |
| 338 | #define rcu_dereference_raw(p) \ | 325 | #define rcu_dereference_raw(p) \ |
| @@ -382,6 +369,7 @@ static inline void rcu_preempt_sleep_check(void) { } · 43 unmodified lines | |||
| 382 | #define rcu_assign_pointer(p, v) \ | 369 | #define rcu_assign_pointer(p, v) \ |
| 383 | ({ \ | 370 | ({ \ |
| 384 | uintptr_t _r_a_p__v = (uintptr_t)(v); \ | 371 | uintptr_t _r_a_p__v = (uintptr_t)(v); \ |
| 372 | rcu_check_sparse(p, __rcu); \ | ||
| 385 | \ | 373 | \ |
| 386 | if (__builtin_constant_p(v) && (_r_a_p__v) == (uintptr_t)NULL) \ | 374 | if (__builtin_constant_p(v) && (_r_a_p__v) == (uintptr_t)NULL) \ |
| 387 | WRITE_ONCE((p), (typeof(p))(_r_a_p__v)); \ | 375 | 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 | |||
| 785 | */ | 773 | */ |
| 786 | #define RCU_INIT_POINTER(p, v) \ | 774 | #define RCU_INIT_POINTER(p, v) \ |
| 787 | do { \ | 775 | do { \ |
| 788 | rcu_dereference_sparse(p, __rcu); \ | 776 | rcu_check_sparse(p, __rcu); \ |
| 789 | WRITE_ONCE(p, RCU_INITIALIZER(v)); \ | 777 | WRITE_ONCE(p, RCU_INITIALIZER(v)); \ |
| 790 | } while (0) | 778 | } while (0) |
| 791 | 779 | ||
| @@ -859,7 +847,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) · 67 unmodified lines | |||
| 859 | 847 | ||
| 860 | /* Has the specified rcu_head structure been handed to call_rcu()? */ | 848 | /* Has the specified rcu_head structure been handed to call_rcu()? */ |
| 861 | 849 | ||
| 862 | /* | 850 | /** |
| 863 | * rcu_head_init - Initialize rcu_head for rcu_head_after_call_rcu() | 851 | * rcu_head_init - Initialize rcu_head for rcu_head_after_call_rcu() |
| 864 | * @rhp: The rcu_head structure to initialize. | 852 | * @rhp: The rcu_head structure to initialize. |
| 865 | * | 853 | * |
| @@ -874,10 +862,10 @@ static inline void rcu_head_init(struct rcu_head *rhp) · 8 unmodified lines | |||
| 874 | rhp->func = (rcu_callback_t)~0L; | 862 | rhp->func = (rcu_callback_t)~0L; |
| 875 | } | 863 | } |
| 876 | 864 | ||
| 877 | /* | 865 | /** |
| 878 | * rcu_head_after_call_rcu - Has this rcu_head been passed to call_rcu()? | 866 | * rcu_head_after_call_rcu - Has this rcu_head been passed to call_rcu()? |
| 879 | * @rhp: The rcu_head structure to test. | 867 | * @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. |
| 881 | * | 869 | * |
| 882 | * Returns @true if the @rhp has been passed to call_rcu() with @func, | 870 | * Returns @true if the @rhp has been passed to call_rcu() with @func, |
| 883 | * and @false otherwise. Emits a warning in any other case, including | 871 | * 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 | |||
| 896 | return false; | 884 | return false; |
| 897 | } | 885 | } |
| 898 | 886 | ||
| 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 | |||
| 952 | #endif /* __LINUX_RCUPDATE_H */ | 887 | #endif /* __LINUX_RCUPDATE_H */ |
| @@ -1,23 +1,10 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition. | 3 | * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition. |
| 3 | * | 4 | * |
| 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 | * | ||
| 18 | * Copyright IBM Corporation, 2008 | 5 | * Copyright IBM Corporation, 2008 |
| 19 | * | 6 | * |
| 20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 7 | * Author: Paul E. McKenney <paulmck@linux.ibm.com> |
| 21 | * | 8 | * |
| 22 | * For detailed explanation of Read-Copy Update mechanism see - | 9 | * For detailed explanation of Read-Copy Update mechanism see - |
| 23 | * Documentation/RCU | 10 | * Documentation/RCU |
| @@ -1,26 +1,13 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * Read-Copy Update mechanism for mutual exclusion (tree-based version) | 3 | * Read-Copy Update mechanism for mutual exclusion (tree-based version) |
| 3 | * | 4 | * |
| 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 | * | ||
| 18 | * Copyright IBM Corporation, 2008 | 5 | * Copyright IBM Corporation, 2008 |
| 19 | * | 6 | * |
| 20 | * Author: Dipankar Sarma <dipankar@in.ibm.com> | 7 | * 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 |
| 22 | * | 9 | * |
| 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> |
| 24 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. | 11 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. |
| 25 | * | 12 | * |
| 26 | * For detailed explanation of Read-Copy Update mechanism see - | 13 | * For detailed explanation of Read-Copy Update mechanism see - |
| @@ -1,24 +1,11 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * Sleepable Read-Copy Update mechanism for mutual exclusion | 3 | * Sleepable Read-Copy Update mechanism for mutual exclusion |
| 3 | * | 4 | * |
| 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 | * | ||
| 18 | * Copyright (C) IBM Corporation, 2006 | 5 | * Copyright (C) IBM Corporation, 2006 |
| 19 | * Copyright (C) Fujitsu, 2012 | 6 | * Copyright (C) Fujitsu, 2012 |
| 20 | * | 7 | * |
| 21 | * Author: Paul McKenney <paulmck@us.ibm.com> | 8 | * Author: Paul McKenney <paulmck@linux.ibm.com> |
| 22 | * Lai Jiangshan <laijs@cn.fujitsu.com> | 9 | * Lai Jiangshan <laijs@cn.fujitsu.com> |
| 23 | * | 10 | * |
| 24 | * For detailed explanation of Read-Copy Update mechanism see - | 11 | * 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 | |||
| 223 | static inline void srcu_read_unlock(struct srcu_struct *ssp, int idx) | 210 | static inline void srcu_read_unlock(struct srcu_struct *ssp, int idx) |
| 224 | __releases(ssp) | 211 | __releases(ssp) |
| 225 | { | 212 | { |
| 213 | WARN_ON_ONCE(idx & ~0x1); | ||
| 226 | rcu_lock_release(&(ssp)->dep_map); | 214 | rcu_lock_release(&(ssp)->dep_map); |
| 227 | __srcu_read_unlock(ssp, idx); | 215 | __srcu_read_unlock(ssp, idx); |
| 228 | } | 216 | } |
| @@ -1,24 +1,11 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * Sleepable Read-Copy Update mechanism for mutual exclusion, | 3 | * Sleepable Read-Copy Update mechanism for mutual exclusion, |
| 3 | * tiny variant. | 4 | * tiny variant. |
| 4 | * | 5 | * |
| 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 | * | ||
| 19 | * Copyright (C) IBM Corporation, 2017 | 6 | * Copyright (C) IBM Corporation, 2017 |
| 20 | * | 7 | * |
| 21 | * Author: Paul McKenney <paulmck@us.ibm.com> | 8 | * Author: Paul McKenney <paulmck@linux.ibm.com> |
| 22 | */ | 9 | */ |
| 23 | 10 | ||
| 24 | #ifndef _LINUX_SRCU_TINY_H | 11 | #ifndef _LINUX_SRCU_TINY_H |
| @@ -1,24 +1,11 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * Sleepable Read-Copy Update mechanism for mutual exclusion, | 3 | * Sleepable Read-Copy Update mechanism for mutual exclusion, |
| 3 | * tree variant. | 4 | * tree variant. |
| 4 | * | 5 | * |
| 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 | * | ||
| 19 | * Copyright (C) IBM Corporation, 2017 | 6 | * Copyright (C) IBM Corporation, 2017 |
| 20 | * | 7 | * |
| 21 | * Author: Paul McKenney <paulmck@us.ibm.com> | 8 | * Author: Paul McKenney <paulmck@linux.ibm.com> |
| 22 | */ | 9 | */ |
| 23 | 10 | ||
| 24 | #ifndef _LINUX_SRCU_TREE_H | 11 | #ifndef _LINUX_SRCU_TREE_H |
| @@ -45,7 +32,8 @@ struct srcu_data { · 20 unmodified lines | |||
| 45 | unsigned long srcu_gp_seq_needed; /* Furthest future GP needed. */ | 32 | unsigned long srcu_gp_seq_needed; /* Furthest future GP needed. */ |
| 46 | unsigned long srcu_gp_seq_needed_exp; /* Furthest future exp GP. */ | 33 | unsigned long srcu_gp_seq_needed_exp; /* Furthest future exp GP. */ |
| 47 | bool srcu_cblist_invoking; /* Invoking these CBs? */ | 34 | 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. */ | ||
| 49 | struct rcu_head srcu_barrier_head; /* For srcu_barrier() use. */ | 37 | struct rcu_head srcu_barrier_head; /* For srcu_barrier() use. */ |
| 50 | struct srcu_node *mynode; /* Leaf srcu_node. */ | 38 | struct srcu_node *mynode; /* Leaf srcu_node. */ |
| 51 | unsigned long grpmask; /* Mask for leaf srcu_node */ | 39 | unsigned long grpmask; /* Mask for leaf srcu_node */ |
| @@ -1,23 +1,10 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0+ */ | ||
| 1 | /* | 2 | /* |
| 2 | * Common functions for in-kernel torture tests. | 3 | * Common functions for in-kernel torture tests. |
| 3 | * | 4 | * |
| 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 | * | ||
| 18 | * Copyright IBM Corporation, 2014 | 5 | * Copyright IBM Corporation, 2014 |
| 19 | * | 6 | * |
| 20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 7 | * Author: Paul E. McKenney <paulmck@linux.ibm.com> |
| 21 | */ | 8 | */ |
| 22 | 9 | ||
| 23 | #ifndef __LINUX_TORTURE_H | 10 | #ifndef __LINUX_TORTURE_H |
| @@ -50,11 +37,12 @@ · 26 unmodified lines | |||
| 50 | do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); } while (0) | 37 | do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); } while (0) |
| 51 | 38 | ||
| 52 | /* Definitions for online/offline exerciser. */ | 39 | /* Definitions for online/offline exerciser. */ |
| 40 | typedef void torture_ofl_func(void); | ||
| 53 | bool torture_offline(int cpu, long *n_onl_attempts, long *n_onl_successes, | 41 | bool torture_offline(int cpu, long *n_onl_attempts, long *n_onl_successes, |
| 54 | unsigned long *sum_offl, int *min_onl, int *max_onl); | 42 | unsigned long *sum_offl, int *min_onl, int *max_onl); |
| 55 | bool torture_online(int cpu, long *n_onl_attempts, long *n_onl_successes, | 43 | bool torture_online(int cpu, long *n_onl_attempts, long *n_onl_successes, |
| 56 | unsigned long *sum_onl, int *min_onl, int *max_onl); | 44 | 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); |
| 58 | void torture_onoff_stats(void); | 46 | void torture_onoff_stats(void); |
| 59 | bool torture_onoff_failures(void); | 47 | bool torture_onoff_failures(void); |
| 60 | 48 | ||