aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-10-05 19:37:03 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-11-28 18:51:20 -0500
commit215bba9f59e35e64b9936da62632b2fa3ede647c (patch)
tree699a1f29f7e1eb3b433091dee38e9ab7f3d53490 /kernel/rcu/tree.c
parent2342172fd6c148506456862d795c7f155baf6797 (diff)
rcu: Fold rcu_eqs_enter_common() into rcu_eqs_enter()
There is now only one call to rcu_eqs_enter_common() and there is no other reason to keep it separate. This commit therefore inlines it into its sole call site, saving a few lines of code in the process. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c43
1 files changed, 16 insertions, 27 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index b2ded4d436c6..5c8a5796c71f 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -749,16 +749,27 @@ cpu_needs_another_gp(struct rcu_state *rsp, struct rcu_data *rdp)
749} 749}
750 750
751/* 751/*
752 * rcu_eqs_enter_common - current CPU is entering an extended quiescent state 752 * Enter an RCU extended quiescent state, which can be either the
753 * idle loop or adaptive-tickless usermode execution.
753 * 754 *
754 * Enter idle, doing appropriate accounting. The caller must have 755 * We crowbar the ->dynticks_nmi_nesting field to zero to allow for
755 * disabled interrupts. 756 * the possibility of usermode upcalls having messed up our count
757 * of interrupt nesting level during the prior busy period.
756 */ 758 */
757static void rcu_eqs_enter_common(bool user) 759static void rcu_eqs_enter(bool user)
758{ 760{
759 struct rcu_state *rsp; 761 struct rcu_state *rsp;
760 struct rcu_data *rdp; 762 struct rcu_data *rdp;
761 struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); 763 struct rcu_dynticks *rdtp;
764
765 rdtp = this_cpu_ptr(&rcu_dynticks);
766 WRITE_ONCE(rdtp->dynticks_nmi_nesting, 0);
767 WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
768 rdtp->dynticks_nesting == 0);
769 if (rdtp->dynticks_nesting != 1) {
770 rdtp->dynticks_nesting--;
771 return;
772 }
762 773
763 lockdep_assert_irqs_disabled(); 774 lockdep_assert_irqs_disabled();
764 trace_rcu_dyntick(TPS("Start"), rdtp->dynticks_nesting, 0, rdtp->dynticks); 775 trace_rcu_dyntick(TPS("Start"), rdtp->dynticks_nesting, 0, rdtp->dynticks);
@@ -783,28 +794,6 @@ static void rcu_eqs_enter_common(bool user)
783 rcu_dynticks_task_enter(); 794 rcu_dynticks_task_enter();
784} 795}
785 796
786/*
787 * Enter an RCU extended quiescent state, which can be either the
788 * idle loop or adaptive-tickless usermode execution.
789 *
790 * We crowbar the ->dynticks_nmi_nesting field to zero to allow for
791 * the possibility of usermode upcalls having messed up our count
792 * of interrupt nesting level during the prior busy period.
793 */
794static void rcu_eqs_enter(bool user)
795{
796 struct rcu_dynticks *rdtp;
797
798 rdtp = this_cpu_ptr(&rcu_dynticks);
799 WRITE_ONCE(rdtp->dynticks_nmi_nesting, 0);
800 WARN_ON_ONCE(IS_ENABLED(CONFIG_RCU_EQS_DEBUG) &&
801 rdtp->dynticks_nesting == 0);
802 if (rdtp->dynticks_nesting == 1)
803 rcu_eqs_enter_common(user);
804 else
805 rdtp->dynticks_nesting--;
806}
807
808/** 797/**
809 * rcu_idle_enter - inform RCU that current CPU is entering idle 798 * rcu_idle_enter - inform RCU that current CPU is entering idle
810 * 799 *