aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcupdate.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-11-17 22:27:16 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-17 19:03:09 -0500
commitffa83fb565fbc397cbafb4b71fd1cce276d4c3b6 (patch)
treec849b1ea3517d6853b7b4cd386a682187e314f09 /include/linux/rcupdate.h
parent2f33b512a5460578f6cf11d7b7867bed53157c7c (diff)
rcu: Optimize rcu_needs_cpu() for RCU_NOCB_CPU_ALL
If CONFIG_RCU_NOCB_CPU_ALL=y, then rcu_needs_cpu() will always return false, however, the current version nevertheless checks for RCU callbacks. This commit therefore creates a static inline implementation of rcu_needs_cpu() that unconditionally returns false when CONFIG_RCU_NOCB_CPU_ALL=y. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r--include/linux/rcupdate.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 281c90f8989e..5f7d5f410d50 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -1015,6 +1015,14 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
1015#define kfree_rcu(ptr, rcu_head) \ 1015#define kfree_rcu(ptr, rcu_head) \
1016 __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) 1016 __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))
1017 1017
1018#if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL)
1019static inline int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies)
1020{
1021 *delta_jiffies = ULONG_MAX;
1022 return 0;
1023}
1024#endif /* #if defined(CONFIG_TINY_RCU) || defined(CONFIG_RCU_NOCB_CPU_ALL) */
1025
1018#if defined(CONFIG_RCU_NOCB_CPU_ALL) 1026#if defined(CONFIG_RCU_NOCB_CPU_ALL)
1019static inline bool rcu_is_nocb_cpu(int cpu) { return true; } 1027static inline bool rcu_is_nocb_cpu(int cpu) { return true; }
1020#elif defined(CONFIG_RCU_NOCB_CPU) 1028#elif defined(CONFIG_RCU_NOCB_CPU)