Miscellaneous fixes for v4.1
Subsystems (6)
cover Miscellaneous fixes for v4.1
Hello!
This series contains miscellaneous fixes:
1. Merge identical definitions of the rcu_synchronize structure
and the wakeme_after_rcu() functions.
2. Avoid needlessly writing to rnp->completed when a new grace
period is started, courtesy of Lai Jiangshan.
3. Fix a couple of typos in rcu_all_qs() comment header.
4. Eliminate CONFIG_PROVE_RCU as a separately settable Kconfig
parameter by driving its value off of CONFIG_PROVE_LOCKING.
5. Remove a #ifdef from tree.c by moving the rcu_init_levelspread()
functions to tree_plugin.h. Only moves code.
6. Improve diagnostics for blocked critical sections in interrupt
handlers.
7. Use IS_ENABLED() to simplify rcu_bootup_announce_oddness().
8. Add rcu_bootup_announce_oddness() check for non-default
CONFIG_RCU_FANOUT_LEAF values.
9. Reverse rcu_dereference_check() conditions to avoid invoking
lockdep functions from NMI handlers.
10. Avoid script syntax error when insufficient CPUs.
11. Put rcu_sched_force_quiescent_state() back where it belongs.
Only code movement.
12. Remove redundant check of cpu_online() by __call_rcu_core(),
courtesy of Yao Dongdong.
Thanx, Paul
PATCH 1/12 rcu: Consolidate rcu_synchronize and wakeme_after_rcu()
From: "Paul E. McKenney" <[email protected]>
There are currently duplicate identical definitions of the rcu_synchronize() structure and the wakeme_after_rcu() function. Thie commit therefore consolidates them.
--- include/linux/rcupdate.h | 9 +++++++++ kernel/rcu/srcu.c | 17 ----------------- kernel/rcu/update.c | 15 ++++++--------- 3 files changed, 15 insertions(+), 26 deletions(-)
include/linux/rcupdate.h +9 -0
@@ -195,6 +195,15 @@ void call_rcu_sched(struct rcu_head *head,void synchronize_sched (void ); +/* +* Structure allowing asynchronous waiting on RCU. +*/ +struct rcu_synchronize { +struct rcu_head head; +struct completion completion; +}; +void wakeme_after_rcu (struct rcu_head *head); +/** * call_rcu_tasks() - Queue an RCU for invocation task-based grace period * @head: structure to be used for queueing the RCU updates.
kernel/rcu/srcu.c +0 -17
@@ -402,23 +402,6 @@ void call_srcu(struct srcu_struct *sp, struct rcu_head *head, }EXPORT_SYMBOL_GPL (call_srcu); -struct rcu_synchronize { -struct rcu_head head; -struct completion completion; -}; - -/* -* Awaken the corresponding synchronize_srcu() instance now that a -* grace period has elapsed. -*/ -static void wakeme_after_rcu (struct rcu_head *head) -{ -struct rcu_synchronize *rcu; - - rcu = container_of(head, struct rcu_synchronize, head); -complete (&rcu->completion); -} -static void srcu_advance_batches (struct srcu_struct *sp,int trycount);static void srcu_reschedule (struct srcu_struct *sp);
kernel/rcu/update.c +6 -9
@@ -199,16 +199,13 @@ EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held);#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ -struct rcu_synchronize { -struct rcu_head head; -struct completion completion; -}; - -/* -* Awaken the corresponding synchronize_rcu() instance now that a -* grace period has elapsed. +/** +* wakeme_after_rcu() - Callback function to awaken a task after grace period +* @head: Pointer to rcu_head member within rcu_synchronize structure +* +* Awaken the corresponding task now that a grace period has elapsed. */ -static void wakeme_after_rcu (struct rcu_head *head) +void wakeme_after_rcu (struct rcu_head *head) {struct rcu_synchronize *rcu;
Signature · 1 line
1.8.1.5
PATCH 2/12 rcu_tree: Avoid touching rnp->completed when a new GP is started
From: Lai Jiangshan <[email protected]>
In rcu_gp_init(), rnp->completed equals to rsp->completed in THEORY, we don't need to touch it normally. If something goes wrong, it will complain and fixup rnp->completed and avoid oops. This commit thus avoids the normal needless store to rnp->completed.
--- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/rcu/tree.c +2 -2
@@ -1757,8 +1757,8 @@ static int rcu_gp_init(struct rcu_state *rsp)rcu_preempt_check_blocked_tasks (rnp); rnp->qsmask = rnp->qsmaskinit;ACCESS_ONCE (rnp->gpnum) = rsp->gpnum; -WARN_ON_ONCE (rnp->completed != rsp->completed); -ACCESS_ONCE (rnp->completed) = rsp->completed; +if (WARN_ON_ONCE (rnp->completed != rsp->completed)) +ACCESS_ONCE (rnp->completed) = rsp->completed;if (rnp == rdp->mynode) (void )__note_gp_changes (rsp, rnp, rdp);rcu_preempt_boost_start_gp (rnp);
Signature · 1 line
1.8.1.5
PATCH 3/12 rcu: Fix a couple of typos in rcu_all_qs() comment header
In reply to Paul E. McKenneyFrom: "Paul E. McKenney" <[email protected]>
--- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/rcu/tree.c +2 -2
@@ -292,10 +292,10 @@ void rcu_note_context_switch(void)EXPORT_SYMBOL_GPL (rcu_note_context_switch);/* -* Register a quiesecent state for all RCU flavors. If there is an +* Register a quiescent state for all RCU flavors. If there is an * emergency, invoke rcu_momentary_dyntick_idle() to do a heavy-weight * dyntick-idle quiescent state visible to other CPUs (but only for those -* RCU flavors in desparate need of a quiescent state, which will normally +* RCU flavors in desperate need of a quiescent state, which will normally * be none of them). Either way, do a lightweight quiescent state for * all RCU flavors. */
Signature · 1 line
1.8.1.5
PATCH 4/12 rcu: Drive PROVE_RCU directly off of PROVE_LOCKING
In reply to Paul E. McKenneyFrom: "Paul E. McKenney" <[email protected]>
In the past, it has been useful to enable PROVE_LOCKING without also enabling PROVE_RCU. However, experience with PROVE_RCU over the past few years has demonstrated its usefulness, so this commit makes PROVE_LOCKING directly imply PROVE_RCU.
--- lib/Kconfig.debug | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
lib/Kconfig.debug +1 -10
@@ -1180,16 +1180,7 @@ config DEBUG_CREDENTIALS menu "RCU Debugging" config PROVE_RCU - bool "RCU debugging: prove RCU correctness" - depends on PROVE_LOCKING - default n - help - This feature enables lockdep extensions that check for correct - use of RCU APIs. This is currently under development. Say Y - if you want to debug RCU usage or help work on the PROVE_RCU - feature. - - Say N if you are unsure. + def_bool PROVE_LOCKING config PROVE_RCU_REPEATEDLY bool "RCU debugging: don't disable PROVE_RCU on first splat"
Signature · 1 line
1.8.1.5
PATCH 5/12 rcu: Remove CONFIG_RCU_FANOUT_EXACT from tree.c file
In reply to Paul E. McKenneyFrom: "Paul E. McKenney" <[email protected]>
This commit moves the rcu_init_levelspread() functions from kernel/rcu/tree.c to kernel/rcu/tree_plugin.h to get an ifdef out of a .c file.
--- kernel/rcu/tree.c | 29 ----------------------------- kernel/rcu/tree.h | 1 + kernel/rcu/tree_plugin.h | 26 ++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 29 deletions(-)
kernel/rcu/tree.c +0 -29
@@ -3731,35 +3731,6 @@ void rcu_scheduler_starting(void) }/* -* Compute the per-level fanout, either using the exact fanout specified -* or balancing the tree, depending on CONFIG_RCU_FANOUT_EXACT. -*/ -#ifdef CONFIG_RCU_FANOUT_EXACT -static void __init rcu_init_levelspread (struct rcu_state *rsp) -{ -int i; - - rsp->levelspread[rcu_num_lvls -1 ] = rcu_fanout_leaf; -for (i = rcu_num_lvls -2 ; i >=0 ; i--) - rsp->levelspread[i] =CONFIG_RCU_FANOUT ; -} -#else /* #ifdef CONFIG_RCU_FANOUT_EXACT */ -static void __init rcu_init_levelspread (struct rcu_state *rsp) -{ -int ccur; -int cprv; -int i; - - cprv = nr_cpu_ids; -for (i = rcu_num_lvls -1 ; i >=0 ; i--) { - ccur = rsp->levelcnt[i]; - rsp->levelspread[i] = (cprv + ccur -1 ) / ccur; - cprv = ccur; - } -} -#endif /* #else #ifdef CONFIG_RCU_FANOUT_EXACT */ - -/* * Helper function for rcu_init() that initializes one rcu_state structure. */ static void __init rcu_init_one(struct rcu_state *rsp,
kernel/rcu/tree.h +1 -0
@@ -595,6 +595,7 @@ static void rcu_sysidle_init_percpu_data(struct rcu_dynticks *rdtp);static bool rcu_nohz_full_cpu (struct rcu_state *rsp);static void rcu_dynticks_task_enter (void );static void rcu_dynticks_task_exit (void ); +static void __init rcu_init_levelspread (struct rcu_state *rsp);#endif /* #ifndef RCU_TREE_NONCORE */
kernel/rcu/tree_plugin.h +26 -0
@@ -3091,3 +3091,29 @@ static void rcu_dynticks_task_exit(void)ACCESS_ONCE (current->rcu_tasks_idle_cpu) =-1 ;#endif /* #if defined(CONFIG_TASKS_RCU) && defined(CONFIG_NO_HZ_FULL) */ } + +/* +* Compute the per-level fanout, either using the exact fanout specified +* or balancing the tree, depending on CONFIG_RCU_FANOUT_EXACT. +*/ +static void __init rcu_init_levelspread (struct rcu_state *rsp) +{ +#ifdef CONFIG_RCU_FANOUT_EXACT +int i; + + rsp->levelspread[rcu_num_lvls -1 ] = rcu_fanout_leaf; +for (i = rcu_num_lvls -2 ; i >=0 ; i--) + rsp->levelspread[i] =CONFIG_RCU_FANOUT ; +#else /* #ifdef CONFIG_RCU_FANOUT_EXACT */ +int ccur; +int cprv; +int i; + + cprv = nr_cpu_ids; +for (i = rcu_num_lvls -1 ; i >=0 ; i--) { + ccur = rsp->levelcnt[i]; + rsp->levelspread[i] = (cprv + ccur -1 ) / ccur; + cprv = ccur; + } +#endif /* #else #ifdef CONFIG_RCU_FANOUT_EXACT */ +}
Signature · 1 line
1.8.1.5
PATCH 6/12 rcu: Improve diagnostics for blocked critical sections in irq
In reply to Paul E. McKenneyFrom: "Paul E. McKenney" <[email protected]>
If an RCU read-side critical section occurs within an interrupt handler or a softirq handler, it cannot have been preempted. Therefore, there is a check in rcu_read_unlock_special() checking for this error. However, when this check triggers, it lacks diagnostic information. This commit therefore moves rcu_read_unlock()'s lockdep annotation to follow the call to __rcu_read_unlock() and changes rcu_read_unlock_special()'s WARN_ON_ONCE() to an lockdep_rcu_suspicious() in order to locate where the offending RCU read-side critical section began. In addition, the value of the ->rcu_read_unlock_special field is printed.
--- include/linux/lockdep.h | 7 ++++++- include/linux/rcupdate.h | 2 +- kernel/rcu/tree_plugin.h | 8 +++++++- 3 files changed, 14 insertions(+), 3 deletions(-)
include/linux/lockdep.h +6 -1
@@ -531,8 +531,13 @@ do { \# define might_lock_read (lock) do { } while (0)#endif -#ifdef CONFIG_PROVE_RCU +#ifdef CONFIG_LOCKDEP void lockdep_rcu_suspicious (const char *file,const int line,const char *s); +#else +static inline void +lockdep_rcu_suspicious (const char *file,const int line,const char *s) +{ +}#endif #endif /* __LINUX_LOCKDEP_H */
include/linux/rcupdate.h +1 -1
@@ -942,9 +942,9 @@ static inline void rcu_read_unlock(void) {rcu_lockdep_assert (rcu_is_watching (),"rcu_read_unlock() used illegally while idle" ); -rcu_lock_release (&rcu_lock_map);__release (RCU );__rcu_read_unlock (); +rcu_lock_release (&rcu_lock_map);/* Keep acq info for rls diags. */ }/**
kernel/rcu/tree_plugin.h +7 -1
@@ -334,7 +334,13 @@ void rcu_read_unlock_special(struct task_struct *t) }/* Hardware IRQ handlers cannot block, complain if they get here. */ -if (WARN_ON_ONCE (in_irq () ||in_serving_softirq ())) { +if (in_irq () ||in_serving_softirq ()) { +lockdep_rcu_suspicious (__FILE__, __LINE__, +"rcu_read_unlock() from irq or softirq with blocking in critical section!!!\n" ); +pr_alert ("->rcu_read_unlock_special: %#x (b: %d, nq: %d)\n" , + t->rcu_read_unlock_special.s, + t->rcu_read_unlock_special.b.blocked, + t->rcu_read_unlock_special.b.need_qs);local_irq_restore (flags);return ; }
Signature · 1 line
1.8.1.5
PATCH 7/12 rcu: Use IS_ENABLED() to simplify rcu_bootup_announce_oddness()
In reply to Paul E. McKenneyFrom: "Paul E. McKenney" <[email protected]>
This commit gets rid of some inline #ifdefs by replacing them with IS_ENABLED.
--- kernel/rcu/tree_plugin.h | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-)
kernel/rcu/tree_plugin.h +20 -28
@@ -58,38 +58,30 @@ static bool __read_mostly rcu_nocb_poll; /* Offload kthread are to poll. */*/ static void __init rcu_bootup_announce_oddness (void ) { -#ifdef CONFIG_RCU_TRACE -pr_info ("\tRCU debugfs-based tracing is enabled.\n" ); -#endif -#if (defined(CONFIG_64BIT ) &&CONFIG_RCU_FANOUT !=64 ) || (!defined(CONFIG_64BIT ) &&CONFIG_RCU_FANOUT !=32 ) -pr_info ("\tCONFIG_RCU_FANOUT set to non-default value of %d\n" , -CONFIG_RCU_FANOUT ); -#endif -#ifdef CONFIG_RCU_FANOUT_EXACT -pr_info ("\tHierarchical RCU autobalancing is disabled.\n" ); -#endif -#ifdef CONFIG_RCU_FAST_NO_HZ -pr_info ("\tRCU dyntick-idle grace-period acceleration is enabled.\n" ); -#endif -#ifdef CONFIG_PROVE_RCU -pr_info ("\tRCU lockdep checking is enabled.\n" ); -#endif -#ifdef CONFIG_RCU_TORTURE_TEST_RUNNABLE -pr_info ("\tRCU torture testing starts during boot.\n" ); -#endif -#if defined(CONFIG_RCU_CPU_STALL_INFO ) -pr_info ("\tAdditional per-CPU info printed with stalls.\n" ); -#endif -#if NUM_RCU_LVL_4 !=0 -pr_info ("\tFour-level hierarchy is enabled.\n" ); -#endif +if (IS_ENABLED (CONFIG_RCU_TRACE )) +pr_info ("\tRCU debugfs-based tracing is enabled.\n" ); +if ((IS_ENABLED (CONFIG_64BIT ) &&CONFIG_RCU_FANOUT !=64 ) || + (!IS_ENABLED (CONFIG_64BIT ) &&CONFIG_RCU_FANOUT !=32 )) +pr_info ("\tCONFIG_RCU_FANOUT set to non-default value of %d\n" , +CONFIG_RCU_FANOUT ); +if (IS_ENABLED (CONFIG_RCU_FANOUT_EXACT )) +pr_info ("\tHierarchical RCU autobalancing is disabled.\n" ); +if (IS_ENABLED (CONFIG_RCU_FAST_NO_HZ )) +pr_info ("\tRCU dyntick-idle grace-period acceleration is enabled.\n" ); +if (IS_ENABLED (CONFIG_PROVE_RCU )) +pr_info ("\tRCU lockdep checking is enabled.\n" ); +if (IS_ENABLED (CONFIG_RCU_TORTURE_TEST_RUNNABLE )) +pr_info ("\tRCU torture testing starts during boot.\n" ); +if (IS_ENABLED (CONFIG_RCU_CPU_STALL_INFO )) +pr_info ("\tAdditional per-CPU info printed with stalls.\n" ); +if (NUM_RCU_LVL_4 !=0 ) +pr_info ("\tFour-level hierarchy is enabled.\n" );if (rcu_fanout_leaf !=CONFIG_RCU_FANOUT_LEAF )pr_info ("\tBoot-time adjustment of leaf fanout to %d.\n" , rcu_fanout_leaf);if (nr_cpu_ids !=NR_CPUS )pr_info ("\tRCU restricting CPUs from NR_CPUS=%d to nr_cpu_ids=%d.\n" ,NR_CPUS , nr_cpu_ids); -#ifdef CONFIG_RCU_BOOST -pr_info ("\tRCU kthread priority: %d.\n" , kthread_prio); -#endif +if (IS_ENABLED (CONFIG_RCU_BOOST )) +pr_info ("\tRCU kthread priority: %d.\n" , kthread_prio); }#ifdef CONFIG_PREEMPT_RCU
Signature · 1 line
1.8.1.5
PATCH 8/12 rcu: Add boot-up check for non-default CONFIG_RCU_FANOUT_LEAF values
In reply to Paul E. McKenneyFrom: "Paul E. McKenney" <[email protected]>
--- kernel/rcu/tree_plugin.h | 3 +++ 1 file changed, 3 insertions(+)
kernel/rcu/tree_plugin.h +3 -0
@@ -76,6 +76,9 @@ static void __init rcu_bootup_announce_oddness(void)pr_info ("\tAdditional per-CPU info printed with stalls.\n" );if (NUM_RCU_LVL_4 !=0 )pr_info ("\tFour-level hierarchy is enabled.\n" ); +if (CONFIG_RCU_FANOUT_LEAF !=16 ) +pr_info ("\tBuild-time adjustment of leaf fanout to %d.\n" , +CONFIG_RCU_FANOUT_LEAF );if (rcu_fanout_leaf !=CONFIG_RCU_FANOUT_LEAF )pr_info ("\tBoot-time adjustment of leaf fanout to %d.\n" , rcu_fanout_leaf);if (nr_cpu_ids !=NR_CPUS )
Signature · 1 line
1.8.1.5
PATCH 9/12 rcu: Reverse rcu_dereference_check() conditions
In reply to Paul E. McKenneyFrom: "Paul E. McKenney" <[email protected]>
The rcu_dereference_check() family of primitives evaluates the RCU lockdep expression first, and only then evaluates the expression passed in. This works fine normally, but can potentially fail in environments (such as NMI handlers) where lockdep cannot be invoked. The problem is that even if the expression passed in is "1", the compiler would need to prove that the RCU lockdep expression (rcu_read_lock_held(), for example) is free of side effects in order to be able to elide it. Given that rcu_read_lock_held() is sometimes separately compiled, the compiler cannot always use this optimization.
This commit therefore reverse the order of evaluation, so that the expression passed in is evaluated first, and the RCU lockdep expression is evaluated only if the passed-in expression evaluated to false, courtesy of the C-language short-circuit boolean evaluation rules. This compells the compiler to forego executing the RCU lockdep expression in cases where the passed-in expression evaluates to "1" at compile time, so that (for example) rcu_dereference_raw() can be guaranteed to execute safely within an NMI handler.
--- include/linux/rcupdate.h | 6 +++--- include/linux/srcu.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
include/linux/rcupdate.h +3 -3
@@ -729,7 +729,7 @@ static inline void rcu_preempt_sleep_check(void)* annotated as __rcu. */ #define rcu_dereference_check (p, c) \ - __rcu_dereference_check((p), rcu_read_lock_held() || (c), __rcu) + __rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)/** * rcu_dereference_bh_check() - rcu_dereference_bh with debug checking
@@ -739,7 +739,7 @@ static inline void rcu_preempt_sleep_check(void)* This is the RCU-bh counterpart to rcu_dereference_check(). */ #define rcu_dereference_bh_check (p, c) \ - __rcu_dereference_check((p), rcu_read_lock_bh_held() || (c), __rcu) + __rcu_dereference_check((p), (c) || rcu_read_lock_bh_held(), __rcu)/** * rcu_dereference_sched_check() - rcu_dereference_sched with debug checking
@@ -749,7 +749,7 @@ static inline void rcu_preempt_sleep_check(void)* This is the RCU-sched counterpart to rcu_dereference_check(). */ #define rcu_dereference_sched_check (p, c) \ - __rcu_dereference_check((p), rcu_read_lock_sched_held() || (c), \ + __rcu_dereference_check((p), (c) || rcu_read_lock_sched_held(), \ __rcu)#define rcu_dereference_raw (p) rcu_dereference_check(p, 1)/*@@@ needed? @@@*/
include/linux/srcu.h +1 -1
@@ -182,7 +182,7 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp)* lockdep_is_held() calls. */ #define srcu_dereference_check (p, sp, c) \ - __rcu_dereference_check((p), srcu_read_lock_held(sp) || (c), __rcu) + __rcu_dereference_check((p), (c) || srcu_read_lock_held(sp), __rcu)/** * srcu_dereference - fetch SRCU-protected pointer for later dereferencing
Signature · 1 line
1.8.1.5
PATCH 10/12 torture: Avoid script syntax error when insufficient CPUs
In reply to Paul E. McKenneyFrom: "Paul E. McKenney" <[email protected]>
Parentheses are special to bash, so use an overflow flag that doesn't use them.
--- tools/testing/selftests/rcutorture/bin/kvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rcutorture/bin/kvm.sh +1 -1
@@ -310,7 +310,7 @@ function dump(first, pastlast) cfr[jn] = cf[j] "." cfrep[cf[j]]; } if (cpusr[jn] > ncpus && ncpus != 0) - ovf = "(!)"; + ovf = "-ovf"; else ovf = ""; print "echo ", cfr[jn], cpusr[jn] ovf ": Starting build. `date`";
Signature · 1 line
1.8.1.5
PATCH 11/12 rcu: Get rcu_sched_force_quiescent_state() where it belongs
In reply to Paul E. McKenneyFrom: "Paul E. McKenney" <[email protected]>
The very similar functions rcu_force_quiescent_state(), rcu_bh_force_quiescent_state(), and rcu_sched_force_quiescent_state() are supposed to be together, but have drifted apart. This commit restores rcu_sched_force_quiescent_state() to its rightful place.
--- kernel/rcu/tree.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
kernel/rcu/tree.c +9 -9
@@ -410,6 +410,15 @@ void rcu_bh_force_quiescent_state(void)EXPORT_SYMBOL_GPL (rcu_bh_force_quiescent_state);/* +* Force a quiescent state for RCU-sched. +*/ +void rcu_sched_force_quiescent_state (void ) +{ +force_quiescent_state (&rcu_sched_state); +} +EXPORT_SYMBOL_GPL (rcu_sched_force_quiescent_state); + +/* * Show the state of the grace-period kthreads. */ void show_rcu_gp_kthreads (void )
@@ -483,15 +492,6 @@ void rcutorture_record_progress(unsigned long vernum)EXPORT_SYMBOL_GPL (rcutorture_record_progress);/* -* Force a quiescent state for RCU-sched. -*/ -void rcu_sched_force_quiescent_state (void ) -{ -force_quiescent_state (&rcu_sched_state); -} -EXPORT_SYMBOL_GPL (rcu_sched_force_quiescent_state); - -/* * Does the CPU have callbacks ready to be invoked? */ static int
Signature · 1 line
1.8.1.5
PATCH 12/12 rcu: Remove redundant check of cpu_online()
In reply to Paul E. McKenneyFrom: Yao Dongdong <[email protected]>
Because invoke_cpu_core() checks whether the current CPU is online, there is no need for __call_rcu_core() to redundantly check it. There should not be any performance degradation because the called function is visible to the compiler. This commit therefore removes the redundant check.
--- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree.c +1 -1
@@ -2741,7 +2741,7 @@ static void __call_rcu_core(struct rcu_state *rsp, struct rcu_data *rdp,* If called from an extended quiescent state, invoke the RCU * core in order to force a re-evaluation of RCU's idleness. */ -if (!rcu_is_watching () &&cpu_online (smp_processor_id ())) +if (!rcu_is_watching ())invoke_rcu_core ();/* If interrupts were disabled or CPU offline, don't invoke RCU core. */
Signature · 1 line
1.8.1.5