Loading fs/file.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -497,7 +497,7 @@ int __alloc_fd(struct files_struct *files, error = fd; error = fd; #if 1 #if 1 /* Sanity check */ /* Sanity check */ if (rcu_dereference_raw(fdt->fd[fd]) != NULL) { if (rcu_access_pointer(fdt->fd[fd]) != NULL) { printk(KERN_WARNING "alloc_fd: slot %d not NULL!\n", fd); printk(KERN_WARNING "alloc_fd: slot %d not NULL!\n", fd); rcu_assign_pointer(fdt->fd[fd], NULL); rcu_assign_pointer(fdt->fd[fd], NULL); } } Loading include/linux/rculist.h +9 −8 Original line number Original line Diff line number Diff line Loading @@ -247,7 +247,8 @@ static inline void list_splice_init_rcu(struct list_head *list, * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). */ */ #define list_entry_rcu(ptr, type, member) \ #define list_entry_rcu(ptr, type, member) \ ({typeof (*ptr) __rcu *__ptr = (typeof (*ptr) __rcu __force *)ptr; \ ({ \ typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; \ container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \ container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \ }) }) Loading Loading @@ -285,10 +286,10 @@ static inline void list_splice_init_rcu(struct list_head *list, * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). */ */ #define list_first_or_null_rcu(ptr, type, member) \ #define list_first_or_null_rcu(ptr, type, member) \ ({struct list_head *__ptr = (ptr); \ ({ \ struct list_head *__ptr = (ptr); \ struct list_head *__next = ACCESS_ONCE(__ptr->next); \ struct list_head *__next = ACCESS_ONCE(__ptr->next); \ likely(__ptr != __next) ? \ likely(__ptr != __next) ? list_entry_rcu(__next, type, member) : NULL; \ list_entry_rcu(__next, type, member) : NULL; \ }) }) /** /** Loading include/linux/rcupdate.h +48 −46 Original line number Original line Diff line number Diff line Loading @@ -12,8 +12,8 @@ * GNU General Public License for more details. * GNU General Public License for more details. * * * You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * along with this program; if not, you can access it online at * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/licenses/gpl-2.0.html. * * * Copyright IBM Corporation, 2001 * Copyright IBM Corporation, 2001 * * Loading Loading @@ -44,7 +44,9 @@ #include <linux/debugobjects.h> #include <linux/debugobjects.h> #include <linux/bug.h> #include <linux/bug.h> #include <linux/compiler.h> #include <linux/compiler.h> #include <asm/barrier.h> extern int rcu_expedited; /* for sysctl */ #ifdef CONFIG_RCU_TORTURE_TEST #ifdef CONFIG_RCU_TORTURE_TEST extern int rcutorture_runnable; /* for sysctl */ extern int rcutorture_runnable; /* for sysctl */ #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ Loading Loading @@ -479,11 +481,9 @@ static inline void rcu_preempt_sleep_check(void) do { \ do { \ rcu_preempt_sleep_check(); \ rcu_preempt_sleep_check(); \ rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \ rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \ "Illegal context switch in RCU-bh" \ "Illegal context switch in RCU-bh read-side critical section"); \ " read-side critical section"); \ rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \ rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \ "Illegal context switch in RCU-sched"\ "Illegal context switch in RCU-sched read-side critical section"); \ " read-side critical section"); \ } while (0) } while (0) #else /* #ifdef CONFIG_PROVE_RCU */ #else /* #ifdef CONFIG_PROVE_RCU */ Loading Loading @@ -518,16 +518,14 @@ static inline void rcu_preempt_sleep_check(void) #define __rcu_dereference_check(p, c, space) \ #define __rcu_dereference_check(p, c, space) \ ({ \ ({ \ typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ rcu_lockdep_assert(c, "suspicious rcu_dereference_check()" \ rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ " usage"); \ rcu_dereference_sparse(p, space); \ rcu_dereference_sparse(p, space); \ smp_read_barrier_depends(); \ smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ ((typeof(*p) __force __kernel *)(_________p1)); \ ((typeof(*p) __force __kernel *)(_________p1)); \ }) }) #define __rcu_dereference_protected(p, c, space) \ #define __rcu_dereference_protected(p, c, space) \ ({ \ ({ \ rcu_lockdep_assert(c, "suspicious rcu_dereference_protected()" \ rcu_lockdep_assert(c, "suspicious rcu_dereference_protected() usage"); \ " usage"); \ rcu_dereference_sparse(p, space); \ rcu_dereference_sparse(p, space); \ ((typeof(*p) __force __kernel *)(p)); \ ((typeof(*p) __force __kernel *)(p)); \ }) }) Loading @@ -542,9 +540,8 @@ static inline void rcu_preempt_sleep_check(void) ({ \ ({ \ typeof(p) _________p1 = ACCESS_ONCE(p); \ typeof(p) _________p1 = ACCESS_ONCE(p); \ rcu_lockdep_assert(c, \ rcu_lockdep_assert(c, \ "suspicious rcu_dereference_index_check()" \ "suspicious rcu_dereference_index_check() usage"); \ " usage"); \ smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ smp_read_barrier_depends(); \ (_________p1); \ (_________p1); \ }) }) Loading Loading @@ -585,12 +582,7 @@ static inline void rcu_preempt_sleep_check(void) * please be careful when making changes to rcu_assign_pointer() and the * please be careful when making changes to rcu_assign_pointer() and the * other macros that it invokes. * other macros that it invokes. */ */ #define rcu_assign_pointer(p, v) \ #define rcu_assign_pointer(p, v) smp_store_release(&p, RCU_INITIALIZER(v)) do { \ smp_wmb(); \ ACCESS_ONCE(p) = RCU_INITIALIZER(v); \ } while (0) /** /** * rcu_access_pointer() - fetch RCU pointer with no dereferencing * rcu_access_pointer() - fetch RCU pointer with no dereferencing Loading Loading @@ -1015,11 +1007,21 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) #define kfree_rcu(ptr, rcu_head) \ #define kfree_rcu(ptr, rcu_head) \ __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) #ifdef CONFIG_RCU_NOCB_CPU #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) { *delta_jiffies = ULONG_MAX; return 0; } #endif /* #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) */ #if defined(CONFIG_RCU_NOCB_CPU_ALL) static inline bool rcu_is_nocb_cpu(int cpu) { return true; } #elif defined(CONFIG_RCU_NOCB_CPU) bool rcu_is_nocb_cpu(int cpu); bool rcu_is_nocb_cpu(int cpu); #else #else static inline bool rcu_is_nocb_cpu(int cpu) { return false; } static inline bool rcu_is_nocb_cpu(int cpu) { return false; } #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ #endif /* Only for use by adaptive-ticks code. */ /* Only for use by adaptive-ticks code. */ Loading include/linux/rcutiny.h +2 −8 Original line number Original line Diff line number Diff line Loading @@ -12,8 +12,8 @@ * GNU General Public License for more details. * GNU General Public License for more details. * * * You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * along with this program; if not, you can access it online at * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/licenses/gpl-2.0.html. * * * Copyright IBM Corporation, 2008 * Copyright IBM Corporation, 2008 * * Loading Loading @@ -68,12 +68,6 @@ static inline void kfree_call_rcu(struct rcu_head *head, call_rcu(head, func); call_rcu(head, func); } } static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) { *delta_jiffies = ULONG_MAX; return 0; } static inline void rcu_note_context_switch(int cpu) static inline void rcu_note_context_switch(int cpu) { { rcu_sched_qs(cpu); rcu_sched_qs(cpu); Loading include/linux/rcutree.h +4 −2 Original line number Original line Diff line number Diff line Loading @@ -12,8 +12,8 @@ * GNU General Public License for more details. * GNU General Public License for more details. * * * You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * along with this program; if not, you can access it online at * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/licenses/gpl-2.0.html. * * * Copyright IBM Corporation, 2008 * Copyright IBM Corporation, 2008 * * Loading @@ -31,7 +31,9 @@ #define __LINUX_RCUTREE_H #define __LINUX_RCUTREE_H void rcu_note_context_switch(int cpu); void rcu_note_context_switch(int cpu); #ifndef CONFIG_RCU_NOCB_CPU_ALL int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); #endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */ void rcu_cpu_stall_reset(void); void rcu_cpu_stall_reset(void); /* /* Loading Loading
fs/file.c +1 −1 Original line number Original line Diff line number Diff line Loading @@ -497,7 +497,7 @@ int __alloc_fd(struct files_struct *files, error = fd; error = fd; #if 1 #if 1 /* Sanity check */ /* Sanity check */ if (rcu_dereference_raw(fdt->fd[fd]) != NULL) { if (rcu_access_pointer(fdt->fd[fd]) != NULL) { printk(KERN_WARNING "alloc_fd: slot %d not NULL!\n", fd); printk(KERN_WARNING "alloc_fd: slot %d not NULL!\n", fd); rcu_assign_pointer(fdt->fd[fd], NULL); rcu_assign_pointer(fdt->fd[fd], NULL); } } Loading
include/linux/rculist.h +9 −8 Original line number Original line Diff line number Diff line Loading @@ -247,7 +247,8 @@ static inline void list_splice_init_rcu(struct list_head *list, * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). */ */ #define list_entry_rcu(ptr, type, member) \ #define list_entry_rcu(ptr, type, member) \ ({typeof (*ptr) __rcu *__ptr = (typeof (*ptr) __rcu __force *)ptr; \ ({ \ typeof(*ptr) __rcu *__ptr = (typeof(*ptr) __rcu __force *)ptr; \ container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \ container_of((typeof(ptr))rcu_dereference_raw(__ptr), type, member); \ }) }) Loading Loading @@ -285,10 +286,10 @@ static inline void list_splice_init_rcu(struct list_head *list, * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). */ */ #define list_first_or_null_rcu(ptr, type, member) \ #define list_first_or_null_rcu(ptr, type, member) \ ({struct list_head *__ptr = (ptr); \ ({ \ struct list_head *__ptr = (ptr); \ struct list_head *__next = ACCESS_ONCE(__ptr->next); \ struct list_head *__next = ACCESS_ONCE(__ptr->next); \ likely(__ptr != __next) ? \ likely(__ptr != __next) ? list_entry_rcu(__next, type, member) : NULL; \ list_entry_rcu(__next, type, member) : NULL; \ }) }) /** /** Loading
include/linux/rcupdate.h +48 −46 Original line number Original line Diff line number Diff line Loading @@ -12,8 +12,8 @@ * GNU General Public License for more details. * GNU General Public License for more details. * * * You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * along with this program; if not, you can access it online at * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/licenses/gpl-2.0.html. * * * Copyright IBM Corporation, 2001 * Copyright IBM Corporation, 2001 * * Loading Loading @@ -44,7 +44,9 @@ #include <linux/debugobjects.h> #include <linux/debugobjects.h> #include <linux/bug.h> #include <linux/bug.h> #include <linux/compiler.h> #include <linux/compiler.h> #include <asm/barrier.h> extern int rcu_expedited; /* for sysctl */ #ifdef CONFIG_RCU_TORTURE_TEST #ifdef CONFIG_RCU_TORTURE_TEST extern int rcutorture_runnable; /* for sysctl */ extern int rcutorture_runnable; /* for sysctl */ #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ Loading Loading @@ -479,11 +481,9 @@ static inline void rcu_preempt_sleep_check(void) do { \ do { \ rcu_preempt_sleep_check(); \ rcu_preempt_sleep_check(); \ rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \ rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \ "Illegal context switch in RCU-bh" \ "Illegal context switch in RCU-bh read-side critical section"); \ " read-side critical section"); \ rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \ rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \ "Illegal context switch in RCU-sched"\ "Illegal context switch in RCU-sched read-side critical section"); \ " read-side critical section"); \ } while (0) } while (0) #else /* #ifdef CONFIG_PROVE_RCU */ #else /* #ifdef CONFIG_PROVE_RCU */ Loading Loading @@ -518,16 +518,14 @@ static inline void rcu_preempt_sleep_check(void) #define __rcu_dereference_check(p, c, space) \ #define __rcu_dereference_check(p, c, space) \ ({ \ ({ \ typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ typeof(*p) *_________p1 = (typeof(*p) *__force)ACCESS_ONCE(p); \ rcu_lockdep_assert(c, "suspicious rcu_dereference_check()" \ rcu_lockdep_assert(c, "suspicious rcu_dereference_check() usage"); \ " usage"); \ rcu_dereference_sparse(p, space); \ rcu_dereference_sparse(p, space); \ smp_read_barrier_depends(); \ smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ ((typeof(*p) __force __kernel *)(_________p1)); \ ((typeof(*p) __force __kernel *)(_________p1)); \ }) }) #define __rcu_dereference_protected(p, c, space) \ #define __rcu_dereference_protected(p, c, space) \ ({ \ ({ \ rcu_lockdep_assert(c, "suspicious rcu_dereference_protected()" \ rcu_lockdep_assert(c, "suspicious rcu_dereference_protected() usage"); \ " usage"); \ rcu_dereference_sparse(p, space); \ rcu_dereference_sparse(p, space); \ ((typeof(*p) __force __kernel *)(p)); \ ((typeof(*p) __force __kernel *)(p)); \ }) }) Loading @@ -542,9 +540,8 @@ static inline void rcu_preempt_sleep_check(void) ({ \ ({ \ typeof(p) _________p1 = ACCESS_ONCE(p); \ typeof(p) _________p1 = ACCESS_ONCE(p); \ rcu_lockdep_assert(c, \ rcu_lockdep_assert(c, \ "suspicious rcu_dereference_index_check()" \ "suspicious rcu_dereference_index_check() usage"); \ " usage"); \ smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ smp_read_barrier_depends(); \ (_________p1); \ (_________p1); \ }) }) Loading Loading @@ -585,12 +582,7 @@ static inline void rcu_preempt_sleep_check(void) * please be careful when making changes to rcu_assign_pointer() and the * please be careful when making changes to rcu_assign_pointer() and the * other macros that it invokes. * other macros that it invokes. */ */ #define rcu_assign_pointer(p, v) \ #define rcu_assign_pointer(p, v) smp_store_release(&p, RCU_INITIALIZER(v)) do { \ smp_wmb(); \ ACCESS_ONCE(p) = RCU_INITIALIZER(v); \ } while (0) /** /** * rcu_access_pointer() - fetch RCU pointer with no dereferencing * rcu_access_pointer() - fetch RCU pointer with no dereferencing Loading Loading @@ -1015,11 +1007,21 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) #define kfree_rcu(ptr, rcu_head) \ #define kfree_rcu(ptr, rcu_head) \ __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) #ifdef CONFIG_RCU_NOCB_CPU #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) { *delta_jiffies = ULONG_MAX; return 0; } #endif /* #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) */ #if defined(CONFIG_RCU_NOCB_CPU_ALL) static inline bool rcu_is_nocb_cpu(int cpu) { return true; } #elif defined(CONFIG_RCU_NOCB_CPU) bool rcu_is_nocb_cpu(int cpu); bool rcu_is_nocb_cpu(int cpu); #else #else static inline bool rcu_is_nocb_cpu(int cpu) { return false; } static inline bool rcu_is_nocb_cpu(int cpu) { return false; } #endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ #endif /* Only for use by adaptive-ticks code. */ /* Only for use by adaptive-ticks code. */ Loading
include/linux/rcutiny.h +2 −8 Original line number Original line Diff line number Diff line Loading @@ -12,8 +12,8 @@ * GNU General Public License for more details. * GNU General Public License for more details. * * * You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * along with this program; if not, you can access it online at * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/licenses/gpl-2.0.html. * * * Copyright IBM Corporation, 2008 * Copyright IBM Corporation, 2008 * * Loading Loading @@ -68,12 +68,6 @@ static inline void kfree_call_rcu(struct rcu_head *head, call_rcu(head, func); call_rcu(head, func); } } static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies) { *delta_jiffies = ULONG_MAX; return 0; } static inline void rcu_note_context_switch(int cpu) static inline void rcu_note_context_switch(int cpu) { { rcu_sched_qs(cpu); rcu_sched_qs(cpu); Loading
include/linux/rcutree.h +4 −2 Original line number Original line Diff line number Diff line Loading @@ -12,8 +12,8 @@ * GNU General Public License for more details. * GNU General Public License for more details. * * * You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * along with this program; if not, you can access it online at * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * http://www.gnu.org/licenses/gpl-2.0.html. * * * Copyright IBM Corporation, 2008 * Copyright IBM Corporation, 2008 * * Loading @@ -31,7 +31,9 @@ #define __LINUX_RCUTREE_H #define __LINUX_RCUTREE_H void rcu_note_context_switch(int cpu); void rcu_note_context_switch(int cpu); #ifndef CONFIG_RCU_NOCB_CPU_ALL int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); #endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */ void rcu_cpu_stall_reset(void); void rcu_cpu_stall_reset(void); /* /* Loading