Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rcu: Rename jiffies_till_flush to jiffies_lazy_flush

The variable name jiffies_till_flush is too generic and therefore:

* It may shadow a global variable
* It doesn't tell on what it operates

Make the name more precise, along with the related APIs.

Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>

authored by

Frederic Weisbecker and committed by
Boqun Feng
499d7e7e 41bccc98

+18 -18
+4 -4
kernel/rcu/rcu.h
··· 543 543 }; 544 544 545 545 #if defined(CONFIG_RCU_LAZY) 546 - unsigned long rcu_lazy_get_jiffies_till_flush(void); 547 - void rcu_lazy_set_jiffies_till_flush(unsigned long j); 546 + unsigned long rcu_get_jiffies_lazy_flush(void); 547 + void rcu_set_jiffies_lazy_flush(unsigned long j); 548 548 #else 549 - static inline unsigned long rcu_lazy_get_jiffies_till_flush(void) { return 0; } 550 - static inline void rcu_lazy_set_jiffies_till_flush(unsigned long j) { } 549 + static inline unsigned long rcu_get_jiffies_lazy_flush(void) { return 0; } 550 + static inline void rcu_set_jiffies_lazy_flush(unsigned long j) { } 551 551 #endif 552 552 553 553 #if defined(CONFIG_TREE_RCU)
+3 -3
kernel/rcu/rcuscale.c
··· 764 764 765 765 if (kfree_by_call_rcu) { 766 766 /* do a test to check the timeout. */ 767 - orig_jif = rcu_lazy_get_jiffies_till_flush(); 767 + orig_jif = rcu_get_jiffies_lazy_flush(); 768 768 769 - rcu_lazy_set_jiffies_till_flush(2 * HZ); 769 + rcu_set_jiffies_lazy_flush(2 * HZ); 770 770 rcu_barrier(); 771 771 772 772 jif_start = jiffies; ··· 775 775 776 776 smp_cond_load_relaxed(&rcu_lazy_test1_cb_called, VAL == 1); 777 777 778 - rcu_lazy_set_jiffies_till_flush(orig_jif); 778 + rcu_set_jiffies_lazy_flush(orig_jif); 779 779 780 780 if (WARN_ON_ONCE(jiffies_at_lazy_cb - jif_start < 2 * HZ)) { 781 781 pr_alert("ERROR: call_rcu() CBs are not being lazy as expected!\n");
+11 -11
kernel/rcu/tree_nocb.h
··· 256 256 return __wake_nocb_gp(rdp_gp, rdp, force, flags); 257 257 } 258 258 259 + #ifdef CONFIG_RCU_LAZY 259 260 /* 260 261 * LAZY_FLUSH_JIFFIES decides the maximum amount of time that 261 262 * can elapse before lazy callbacks are flushed. Lazy callbacks ··· 265 264 * left unsubmitted to RCU after those many jiffies. 266 265 */ 267 266 #define LAZY_FLUSH_JIFFIES (10 * HZ) 268 - static unsigned long jiffies_till_flush = LAZY_FLUSH_JIFFIES; 267 + static unsigned long jiffies_lazy_flush = LAZY_FLUSH_JIFFIES; 269 268 270 - #ifdef CONFIG_RCU_LAZY 271 269 // To be called only from test code. 272 - void rcu_lazy_set_jiffies_till_flush(unsigned long jif) 270 + void rcu_set_jiffies_lazy_flush(unsigned long jif) 273 271 { 274 - jiffies_till_flush = jif; 272 + jiffies_lazy_flush = jif; 275 273 } 276 - EXPORT_SYMBOL(rcu_lazy_set_jiffies_till_flush); 274 + EXPORT_SYMBOL(rcu_set_jiffies_lazy_flush); 277 275 278 - unsigned long rcu_lazy_get_jiffies_till_flush(void) 276 + unsigned long rcu_get_jiffies_lazy_flush(void) 279 277 { 280 - return jiffies_till_flush; 278 + return jiffies_lazy_flush; 281 279 } 282 - EXPORT_SYMBOL(rcu_lazy_get_jiffies_till_flush); 280 + EXPORT_SYMBOL(rcu_get_jiffies_lazy_flush); 283 281 #endif 284 282 285 283 /* ··· 299 299 */ 300 300 if (waketype == RCU_NOCB_WAKE_LAZY && 301 301 rdp->nocb_defer_wakeup == RCU_NOCB_WAKE_NOT) { 302 - mod_timer(&rdp_gp->nocb_timer, jiffies + jiffies_till_flush); 302 + mod_timer(&rdp_gp->nocb_timer, jiffies + rcu_get_jiffies_lazy_flush()); 303 303 WRITE_ONCE(rdp_gp->nocb_defer_wakeup, waketype); 304 304 } else if (waketype == RCU_NOCB_WAKE_BYPASS) { 305 305 mod_timer(&rdp_gp->nocb_timer, jiffies + 2); ··· 482 482 // flush ->nocb_bypass to ->cblist. 483 483 if ((ncbs && !bypass_is_lazy && j != READ_ONCE(rdp->nocb_bypass_first)) || 484 484 (ncbs && bypass_is_lazy && 485 - (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + jiffies_till_flush))) || 485 + (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + rcu_get_jiffies_lazy_flush()))) || 486 486 ncbs >= qhimark) { 487 487 rcu_nocb_lock(rdp); 488 488 *was_alldone = !rcu_segcblist_pend_cbs(&rdp->cblist); ··· 723 723 lazy_ncbs = READ_ONCE(rdp->lazy_len); 724 724 725 725 if (bypass_ncbs && (lazy_ncbs == bypass_ncbs) && 726 - (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + jiffies_till_flush) || 726 + (time_after(j, READ_ONCE(rdp->nocb_bypass_first) + rcu_get_jiffies_lazy_flush()) || 727 727 bypass_ncbs > 2 * qhimark)) { 728 728 flush_bypass = true; 729 729 } else if (bypass_ncbs && (lazy_ncbs != bypass_ncbs) &&