aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-12-08 14:37:24 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2018-02-20 19:21:57 -0500
commitf7c0e6ad4bb1ab1cf358b8815f7d0ba7ff94d786 (patch)
treeadf1a133ca5cb7f8aa7ab92a63098638d9e40655
parenteb0339934f1d468ff09d9be1c608c89cb1da850b (diff)
rcutorture: Re-enable testing of dynamic expediting
During boot, normal grace periods are processed as expedited. When rcutorture is built into the kernel, it starts during boot and thus detects that normal grace periods are unconditionally expedited. Therefore, rcutorture concludes that there is no point in trying to dynamically enable expediting, do it disables this aspect of testing, which is a bit of an overreaction to the temporary boot-time expediting. This commit therefore rechecks forced expediting throughout the test, enabling dynamic expediting if normal grace periods are processed normally at any point. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r--kernel/rcu/rcutorture.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 6c46cd1d8fd7..2964b9236ddc 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -909,14 +909,10 @@ rcu_torture_writer(void *arg)
909 int nsynctypes = 0; 909 int nsynctypes = 0;
910 910
911 VERBOSE_TOROUT_STRING("rcu_torture_writer task started"); 911 VERBOSE_TOROUT_STRING("rcu_torture_writer task started");
912 if (!can_expedite) { 912 if (!can_expedite)
913 pr_alert("%s" TORTURE_FLAG 913 pr_alert("%s" TORTURE_FLAG
914 " GP expediting controlled from boot/sysfs for %s,\n", 914 " GP expediting controlled from boot/sysfs for %s.\n",
915 torture_type, cur_ops->name); 915 torture_type, cur_ops->name);
916 pr_alert("%s" TORTURE_FLAG
917 " Disabled dynamic grace-period expediting.\n",
918 torture_type);
919 }
920 916
921 /* Initialize synctype[] array. If none set, take default. */ 917 /* Initialize synctype[] array. If none set, take default. */
922 if (!gp_cond1 && !gp_exp1 && !gp_normal1 && !gp_sync1) 918 if (!gp_cond1 && !gp_exp1 && !gp_normal1 && !gp_sync1)
@@ -1011,6 +1007,9 @@ rcu_torture_writer(void *arg)
1011 rcu_unexpedite_gp(); 1007 rcu_unexpedite_gp();
1012 if (++expediting > 3) 1008 if (++expediting > 3)
1013 expediting = -expediting; 1009 expediting = -expediting;
1010 } else if (!can_expedite) { /* Disabled during boot, recheck. */
1011 can_expedite = !rcu_gp_is_expedited() &&
1012 !rcu_gp_is_normal();
1014 } 1013 }
1015 rcu_torture_writer_state = RTWS_STUTTER; 1014 rcu_torture_writer_state = RTWS_STUTTER;
1016 stutter_wait("rcu_torture_writer"); 1015 stutter_wait("rcu_torture_writer");
@@ -1021,6 +1020,10 @@ rcu_torture_writer(void *arg)
1021 while (can_expedite && expediting++ < 0) 1020 while (can_expedite && expediting++ < 0)
1022 rcu_unexpedite_gp(); 1021 rcu_unexpedite_gp();
1023 WARN_ON_ONCE(can_expedite && rcu_gp_is_expedited()); 1022 WARN_ON_ONCE(can_expedite && rcu_gp_is_expedited());
1023 if (!can_expedite)
1024 pr_alert("%s" TORTURE_FLAG
1025 " Dynamic grace-period expediting was disabled.\n",
1026 torture_type);
1024 rcu_torture_writer_state = RTWS_STOPPING; 1027 rcu_torture_writer_state = RTWS_STOPPING;
1025 torture_kthread_stopping("rcu_torture_writer"); 1028 torture_kthread_stopping("rcu_torture_writer");
1026 return 0; 1029 return 0;