diff options
| author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-05-16 19:01:56 -0400 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2018-07-12 18:39:16 -0400 |
| commit | 3b57a3994f330a102b91bd70c84c9530c0ae50f6 (patch) | |
| tree | d4ce4310f49b1ea336ebdb419f8e35d452d36089 /kernel/rcu/tree.c | |
| parent | 15651201fa055ec81d3669b36ab7c2fb12c3ce36 (diff) | |
rcu: Inline rcu_dynticks_momentary_idle() into its sole caller
The rcu_dynticks_momentary_idle() function is invoked only from
rcu_momentary_dyntick_idle(), and neither function is particularly
large. This commit therefore saves a few lines by inlining
rcu_dynticks_momentary_idle() into rcu_momentary_dyntick_idle().
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
| -rw-r--r-- | kernel/rcu/tree.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index ccc061acf887..ebdbb5f96e5c 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
| @@ -386,20 +386,6 @@ static bool rcu_dynticks_in_eqs_since(struct rcu_dynticks *rdtp, int snap) | |||
| 386 | } | 386 | } |
| 387 | 387 | ||
| 388 | /* | 388 | /* |
| 389 | * Do a double-increment of the ->dynticks counter to emulate a | ||
| 390 | * momentary idle-CPU quiescent state. | ||
| 391 | */ | ||
| 392 | static void rcu_dynticks_momentary_idle(void) | ||
| 393 | { | ||
| 394 | struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); | ||
| 395 | int special = atomic_add_return(2 * RCU_DYNTICK_CTRL_CTR, | ||
| 396 | &rdtp->dynticks); | ||
| 397 | |||
| 398 | /* It is illegal to call this from idle state. */ | ||
| 399 | WARN_ON_ONCE(!(special & RCU_DYNTICK_CTRL_CTR)); | ||
| 400 | } | ||
| 401 | |||
| 402 | /* | ||
| 403 | * Set the special (bottom) bit of the specified CPU so that it | 389 | * Set the special (bottom) bit of the specified CPU so that it |
| 404 | * will take special action (such as flushing its TLB) on the | 390 | * will take special action (such as flushing its TLB) on the |
| 405 | * next exit from an extended quiescent state. Returns true if | 391 | * next exit from an extended quiescent state. Returns true if |
| @@ -430,12 +416,17 @@ bool rcu_eqs_special_set(int cpu) | |||
| 430 | * | 416 | * |
| 431 | * We inform the RCU core by emulating a zero-duration dyntick-idle period. | 417 | * We inform the RCU core by emulating a zero-duration dyntick-idle period. |
| 432 | * | 418 | * |
| 433 | * The caller must have disabled interrupts. | 419 | * The caller must have disabled interrupts and must not be idle. |
| 434 | */ | 420 | */ |
| 435 | static void rcu_momentary_dyntick_idle(void) | 421 | static void rcu_momentary_dyntick_idle(void) |
| 436 | { | 422 | { |
| 423 | struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); | ||
| 424 | int special; | ||
| 425 | |||
| 437 | raw_cpu_write(rcu_dynticks.rcu_need_heavy_qs, false); | 426 | raw_cpu_write(rcu_dynticks.rcu_need_heavy_qs, false); |
| 438 | rcu_dynticks_momentary_idle(); | 427 | special = atomic_add_return(2 * RCU_DYNTICK_CTRL_CTR, &rdtp->dynticks); |
| 428 | /* It is illegal to call this from idle state. */ | ||
| 429 | WARN_ON_ONCE(!(special & RCU_DYNTICK_CTRL_CTR)); | ||
| 439 | } | 430 | } |
| 440 | 431 | ||
| 441 | /* | 432 | /* |
