提交 5ccf60f2 编写于 作者: P Paul E. McKenney

rcutorture: Rename PRINTK to TOROUT

Since it doesn't do printk()s anymore anyway, this commit renames these
macros from PRINTK to TOROUT (short for torture output).
Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
上级 9e250225
...@@ -98,11 +98,11 @@ module_param(torture_type, charp, 0444); ...@@ -98,11 +98,11 @@ module_param(torture_type, charp, 0444);
MODULE_PARM_DESC(torture_type, "Type of RCU to torture (rcu, rcu_bh, ...)"); MODULE_PARM_DESC(torture_type, "Type of RCU to torture (rcu, rcu_bh, ...)");
#define TORTURE_FLAG "-torture:" #define TORTURE_FLAG "-torture:"
#define PRINTK_STRING(s) \ #define TOROUT_STRING(s) \
do { pr_alert("%s" TORTURE_FLAG s "\n", torture_type); } while (0) do { pr_alert("%s" TORTURE_FLAG s "\n", torture_type); } while (0)
#define VERBOSE_PRINTK_STRING(s) \ #define VERBOSE_TOROUT_STRING(s) \
do { if (verbose) pr_alert("%s" TORTURE_FLAG s "\n", torture_type); } while (0) do { if (verbose) pr_alert("%s" TORTURE_FLAG s "\n", torture_type); } while (0)
#define VERBOSE_PRINTK_ERRSTRING(s) \ #define VERBOSE_TOROUT_ERRSTRING(s) \
do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! " s "\n", torture_type); } while (0) do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! " s "\n", torture_type); } while (0)
static int nrealreaders; static int nrealreaders;
...@@ -619,12 +619,12 @@ static int rcu_torture_boost(void *arg) ...@@ -619,12 +619,12 @@ static int rcu_torture_boost(void *arg)
struct rcu_boost_inflight rbi = { .inflight = 0 }; struct rcu_boost_inflight rbi = { .inflight = 0 };
struct sched_param sp; struct sched_param sp;
VERBOSE_PRINTK_STRING("rcu_torture_boost started"); VERBOSE_TOROUT_STRING("rcu_torture_boost started");
/* Set real-time priority. */ /* Set real-time priority. */
sp.sched_priority = 1; sp.sched_priority = 1;
if (sched_setscheduler(current, SCHED_FIFO, &sp) < 0) { if (sched_setscheduler(current, SCHED_FIFO, &sp) < 0) {
VERBOSE_PRINTK_STRING("rcu_torture_boost RT prio failed!"); VERBOSE_TOROUT_STRING("rcu_torture_boost RT prio failed!");
n_rcu_torture_boost_rterror++; n_rcu_torture_boost_rterror++;
} }
...@@ -652,7 +652,7 @@ static int rcu_torture_boost(void *arg) ...@@ -652,7 +652,7 @@ static int rcu_torture_boost(void *arg)
call_rcu(&rbi.rcu, rcu_torture_boost_cb); call_rcu(&rbi.rcu, rcu_torture_boost_cb);
if (jiffies - call_rcu_time > if (jiffies - call_rcu_time >
test_boost_duration * HZ - HZ / 2) { test_boost_duration * HZ - HZ / 2) {
VERBOSE_PRINTK_STRING("rcu_torture_boost boosting failed"); VERBOSE_TOROUT_STRING("rcu_torture_boost boosting failed");
n_rcu_torture_boost_failure++; n_rcu_torture_boost_failure++;
} }
call_rcu_time = jiffies; call_rcu_time = jiffies;
...@@ -688,7 +688,7 @@ checkwait: rcu_stutter_wait("rcu_torture_boost"); ...@@ -688,7 +688,7 @@ checkwait: rcu_stutter_wait("rcu_torture_boost");
} while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP);
/* Clean up and exit. */ /* Clean up and exit. */
VERBOSE_PRINTK_STRING("rcu_torture_boost task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_boost task stopping");
rcutorture_shutdown_absorb("rcu_torture_boost"); rcutorture_shutdown_absorb("rcu_torture_boost");
while (!kthread_should_stop() || rbi.inflight) while (!kthread_should_stop() || rbi.inflight)
schedule_timeout_uninterruptible(1); schedule_timeout_uninterruptible(1);
...@@ -708,7 +708,7 @@ rcu_torture_fqs(void *arg) ...@@ -708,7 +708,7 @@ rcu_torture_fqs(void *arg)
unsigned long fqs_resume_time; unsigned long fqs_resume_time;
int fqs_burst_remaining; int fqs_burst_remaining;
VERBOSE_PRINTK_STRING("rcu_torture_fqs task started"); VERBOSE_TOROUT_STRING("rcu_torture_fqs task started");
do { do {
fqs_resume_time = jiffies + fqs_stutter * HZ; fqs_resume_time = jiffies + fqs_stutter * HZ;
while (ULONG_CMP_LT(jiffies, fqs_resume_time) && while (ULONG_CMP_LT(jiffies, fqs_resume_time) &&
...@@ -724,7 +724,7 @@ rcu_torture_fqs(void *arg) ...@@ -724,7 +724,7 @@ rcu_torture_fqs(void *arg)
} }
rcu_stutter_wait("rcu_torture_fqs"); rcu_stutter_wait("rcu_torture_fqs");
} while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP);
VERBOSE_PRINTK_STRING("rcu_torture_fqs task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_fqs task stopping");
rcutorture_shutdown_absorb("rcu_torture_fqs"); rcutorture_shutdown_absorb("rcu_torture_fqs");
while (!kthread_should_stop()) while (!kthread_should_stop())
schedule_timeout_uninterruptible(1); schedule_timeout_uninterruptible(1);
...@@ -746,7 +746,7 @@ rcu_torture_writer(void *arg) ...@@ -746,7 +746,7 @@ rcu_torture_writer(void *arg)
struct rcu_torture *old_rp; struct rcu_torture *old_rp;
static DEFINE_TORTURE_RANDOM(rand); static DEFINE_TORTURE_RANDOM(rand);
VERBOSE_PRINTK_STRING("rcu_torture_writer task started"); VERBOSE_TOROUT_STRING("rcu_torture_writer task started");
set_user_nice(current, 19); set_user_nice(current, 19);
do { do {
...@@ -796,7 +796,7 @@ rcu_torture_writer(void *arg) ...@@ -796,7 +796,7 @@ rcu_torture_writer(void *arg)
rcutorture_record_progress(++rcu_torture_current_version); rcutorture_record_progress(++rcu_torture_current_version);
rcu_stutter_wait("rcu_torture_writer"); rcu_stutter_wait("rcu_torture_writer");
} while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP);
VERBOSE_PRINTK_STRING("rcu_torture_writer task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_writer task stopping");
rcutorture_shutdown_absorb("rcu_torture_writer"); rcutorture_shutdown_absorb("rcu_torture_writer");
while (!kthread_should_stop()) while (!kthread_should_stop())
schedule_timeout_uninterruptible(1); schedule_timeout_uninterruptible(1);
...@@ -812,7 +812,7 @@ rcu_torture_fakewriter(void *arg) ...@@ -812,7 +812,7 @@ rcu_torture_fakewriter(void *arg)
{ {
DEFINE_TORTURE_RANDOM(rand); DEFINE_TORTURE_RANDOM(rand);
VERBOSE_PRINTK_STRING("rcu_torture_fakewriter task started"); VERBOSE_TOROUT_STRING("rcu_torture_fakewriter task started");
set_user_nice(current, 19); set_user_nice(current, 19);
do { do {
...@@ -834,7 +834,7 @@ rcu_torture_fakewriter(void *arg) ...@@ -834,7 +834,7 @@ rcu_torture_fakewriter(void *arg)
rcu_stutter_wait("rcu_torture_fakewriter"); rcu_stutter_wait("rcu_torture_fakewriter");
} while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP);
VERBOSE_PRINTK_STRING("rcu_torture_fakewriter task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_fakewriter task stopping");
rcutorture_shutdown_absorb("rcu_torture_fakewriter"); rcutorture_shutdown_absorb("rcu_torture_fakewriter");
while (!kthread_should_stop()) while (!kthread_should_stop())
schedule_timeout_uninterruptible(1); schedule_timeout_uninterruptible(1);
...@@ -928,7 +928,7 @@ rcu_torture_reader(void *arg) ...@@ -928,7 +928,7 @@ rcu_torture_reader(void *arg)
struct timer_list t; struct timer_list t;
unsigned long long ts; unsigned long long ts;
VERBOSE_PRINTK_STRING("rcu_torture_reader task started"); VERBOSE_TOROUT_STRING("rcu_torture_reader task started");
set_user_nice(current, 19); set_user_nice(current, 19);
if (irqreader && cur_ops->irq_capable) if (irqreader && cur_ops->irq_capable)
setup_timer_on_stack(&t, rcu_torture_timer, 0); setup_timer_on_stack(&t, rcu_torture_timer, 0);
...@@ -978,7 +978,7 @@ rcu_torture_reader(void *arg) ...@@ -978,7 +978,7 @@ rcu_torture_reader(void *arg)
schedule(); schedule();
rcu_stutter_wait("rcu_torture_reader"); rcu_stutter_wait("rcu_torture_reader");
} while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP);
VERBOSE_PRINTK_STRING("rcu_torture_reader task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_reader task stopping");
rcutorture_shutdown_absorb("rcu_torture_reader"); rcutorture_shutdown_absorb("rcu_torture_reader");
if (irqreader && cur_ops->irq_capable) if (irqreader && cur_ops->irq_capable)
del_timer_sync(&t); del_timer_sync(&t);
...@@ -1099,13 +1099,13 @@ rcu_torture_stats_print(void) ...@@ -1099,13 +1099,13 @@ rcu_torture_stats_print(void)
static int static int
rcu_torture_stats(void *arg) rcu_torture_stats(void *arg)
{ {
VERBOSE_PRINTK_STRING("rcu_torture_stats task started"); VERBOSE_TOROUT_STRING("rcu_torture_stats task started");
do { do {
schedule_timeout_interruptible(stat_interval * HZ); schedule_timeout_interruptible(stat_interval * HZ);
rcu_torture_stats_print(); rcu_torture_stats_print();
rcutorture_shutdown_absorb("rcu_torture_stats"); rcutorture_shutdown_absorb("rcu_torture_stats");
} while (!kthread_should_stop()); } while (!kthread_should_stop());
VERBOSE_PRINTK_STRING("rcu_torture_stats task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_stats task stopping");
return 0; return 0;
} }
...@@ -1183,13 +1183,13 @@ static void rcu_torture_shuffle_tasks(void) ...@@ -1183,13 +1183,13 @@ static void rcu_torture_shuffle_tasks(void)
static int static int
rcu_torture_shuffle(void *arg) rcu_torture_shuffle(void *arg)
{ {
VERBOSE_PRINTK_STRING("rcu_torture_shuffle task started"); VERBOSE_TOROUT_STRING("rcu_torture_shuffle task started");
do { do {
schedule_timeout_interruptible(shuffle_interval * HZ); schedule_timeout_interruptible(shuffle_interval * HZ);
rcu_torture_shuffle_tasks(); rcu_torture_shuffle_tasks();
rcutorture_shutdown_absorb("rcu_torture_shuffle"); rcutorture_shutdown_absorb("rcu_torture_shuffle");
} while (!kthread_should_stop()); } while (!kthread_should_stop());
VERBOSE_PRINTK_STRING("rcu_torture_shuffle task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_shuffle task stopping");
return 0; return 0;
} }
...@@ -1199,7 +1199,7 @@ rcu_torture_shuffle(void *arg) ...@@ -1199,7 +1199,7 @@ rcu_torture_shuffle(void *arg)
static int static int
rcu_torture_stutter(void *arg) rcu_torture_stutter(void *arg)
{ {
VERBOSE_PRINTK_STRING("rcu_torture_stutter task started"); VERBOSE_TOROUT_STRING("rcu_torture_stutter task started");
do { do {
schedule_timeout_interruptible(stutter * HZ); schedule_timeout_interruptible(stutter * HZ);
stutter_pause_test = 1; stutter_pause_test = 1;
...@@ -1208,7 +1208,7 @@ rcu_torture_stutter(void *arg) ...@@ -1208,7 +1208,7 @@ rcu_torture_stutter(void *arg)
stutter_pause_test = 0; stutter_pause_test = 0;
rcutorture_shutdown_absorb("rcu_torture_stutter"); rcutorture_shutdown_absorb("rcu_torture_stutter");
} while (!kthread_should_stop()); } while (!kthread_should_stop());
VERBOSE_PRINTK_STRING("rcu_torture_stutter task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_stutter task stopping");
return 0; return 0;
} }
...@@ -1246,7 +1246,7 @@ static void rcutorture_booster_cleanup(int cpu) ...@@ -1246,7 +1246,7 @@ static void rcutorture_booster_cleanup(int cpu)
if (boost_tasks[cpu] == NULL) if (boost_tasks[cpu] == NULL)
return; return;
mutex_lock(&boost_mutex); mutex_lock(&boost_mutex);
VERBOSE_PRINTK_STRING("Stopping rcu_torture_boost task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_boost task");
t = boost_tasks[cpu]; t = boost_tasks[cpu];
boost_tasks[cpu] = NULL; boost_tasks[cpu] = NULL;
mutex_unlock(&boost_mutex); mutex_unlock(&boost_mutex);
...@@ -1265,13 +1265,13 @@ static int rcutorture_booster_init(int cpu) ...@@ -1265,13 +1265,13 @@ static int rcutorture_booster_init(int cpu)
/* Don't allow time recalculation while creating a new task. */ /* Don't allow time recalculation while creating a new task. */
mutex_lock(&boost_mutex); mutex_lock(&boost_mutex);
VERBOSE_PRINTK_STRING("Creating rcu_torture_boost task"); VERBOSE_TOROUT_STRING("Creating rcu_torture_boost task");
boost_tasks[cpu] = kthread_create_on_node(rcu_torture_boost, NULL, boost_tasks[cpu] = kthread_create_on_node(rcu_torture_boost, NULL,
cpu_to_node(cpu), cpu_to_node(cpu),
"rcu_torture_boost"); "rcu_torture_boost");
if (IS_ERR(boost_tasks[cpu])) { if (IS_ERR(boost_tasks[cpu])) {
retval = PTR_ERR(boost_tasks[cpu]); retval = PTR_ERR(boost_tasks[cpu]);
VERBOSE_PRINTK_STRING("rcu_torture_boost task create failed"); VERBOSE_TOROUT_STRING("rcu_torture_boost task create failed");
n_rcu_torture_boost_ktrerror++; n_rcu_torture_boost_ktrerror++;
boost_tasks[cpu] = NULL; boost_tasks[cpu] = NULL;
mutex_unlock(&boost_mutex); mutex_unlock(&boost_mutex);
...@@ -1293,7 +1293,7 @@ rcu_torture_shutdown(void *arg) ...@@ -1293,7 +1293,7 @@ rcu_torture_shutdown(void *arg)
long delta; long delta;
unsigned long jiffies_snap; unsigned long jiffies_snap;
VERBOSE_PRINTK_STRING("rcu_torture_shutdown task started"); VERBOSE_TOROUT_STRING("rcu_torture_shutdown task started");
jiffies_snap = ACCESS_ONCE(jiffies); jiffies_snap = ACCESS_ONCE(jiffies);
while (ULONG_CMP_LT(jiffies_snap, shutdown_time) && while (ULONG_CMP_LT(jiffies_snap, shutdown_time) &&
!kthread_should_stop()) { !kthread_should_stop()) {
...@@ -1306,13 +1306,13 @@ rcu_torture_shutdown(void *arg) ...@@ -1306,13 +1306,13 @@ rcu_torture_shutdown(void *arg)
jiffies_snap = ACCESS_ONCE(jiffies); jiffies_snap = ACCESS_ONCE(jiffies);
} }
if (kthread_should_stop()) { if (kthread_should_stop()) {
VERBOSE_PRINTK_STRING("rcu_torture_shutdown task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_shutdown task stopping");
return 0; return 0;
} }
/* OK, shut down the system. */ /* OK, shut down the system. */
VERBOSE_PRINTK_STRING("rcu_torture_shutdown task shutting down system"); VERBOSE_TOROUT_STRING("rcu_torture_shutdown task shutting down system");
shutdown_task = NULL; /* Avoid self-kill deadlock. */ shutdown_task = NULL; /* Avoid self-kill deadlock. */
rcu_torture_cleanup(); /* Get the success/failure message. */ rcu_torture_cleanup(); /* Get the success/failure message. */
kernel_power_off(); /* Shut down the system. */ kernel_power_off(); /* Shut down the system. */
...@@ -1335,14 +1335,14 @@ rcu_torture_onoff(void *arg) ...@@ -1335,14 +1335,14 @@ rcu_torture_onoff(void *arg)
int ret; int ret;
unsigned long starttime; unsigned long starttime;
VERBOSE_PRINTK_STRING("rcu_torture_onoff task started"); VERBOSE_TOROUT_STRING("rcu_torture_onoff task started");
for_each_online_cpu(cpu) for_each_online_cpu(cpu)
maxcpu = cpu; maxcpu = cpu;
WARN_ON(maxcpu < 0); WARN_ON(maxcpu < 0);
if (onoff_holdoff > 0) { if (onoff_holdoff > 0) {
VERBOSE_PRINTK_STRING("rcu_torture_onoff begin holdoff"); VERBOSE_TOROUT_STRING("rcu_torture_onoff begin holdoff");
schedule_timeout_interruptible(onoff_holdoff * HZ); schedule_timeout_interruptible(onoff_holdoff * HZ);
VERBOSE_PRINTK_STRING("rcu_torture_onoff end holdoff"); VERBOSE_TOROUT_STRING("rcu_torture_onoff end holdoff");
} }
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
cpu = (torture_random(&rand) >> 4) % (maxcpu + 1); cpu = (torture_random(&rand) >> 4) % (maxcpu + 1);
...@@ -1409,7 +1409,7 @@ rcu_torture_onoff(void *arg) ...@@ -1409,7 +1409,7 @@ rcu_torture_onoff(void *arg)
} }
schedule_timeout_interruptible(onoff_interval * HZ); schedule_timeout_interruptible(onoff_interval * HZ);
} }
VERBOSE_PRINTK_STRING("rcu_torture_onoff task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_onoff task stopping");
return 0; return 0;
} }
...@@ -1433,7 +1433,7 @@ static void rcu_torture_onoff_cleanup(void) ...@@ -1433,7 +1433,7 @@ static void rcu_torture_onoff_cleanup(void)
{ {
if (onoff_task == NULL) if (onoff_task == NULL)
return; return;
VERBOSE_PRINTK_STRING("Stopping rcu_torture_onoff task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_onoff task");
kthread_stop(onoff_task); kthread_stop(onoff_task);
onoff_task = NULL; onoff_task = NULL;
} }
...@@ -1460,11 +1460,11 @@ static int rcu_torture_stall(void *args) ...@@ -1460,11 +1460,11 @@ static int rcu_torture_stall(void *args)
{ {
unsigned long stop_at; unsigned long stop_at;
VERBOSE_PRINTK_STRING("rcu_torture_stall task started"); VERBOSE_TOROUT_STRING("rcu_torture_stall task started");
if (stall_cpu_holdoff > 0) { if (stall_cpu_holdoff > 0) {
VERBOSE_PRINTK_STRING("rcu_torture_stall begin holdoff"); VERBOSE_TOROUT_STRING("rcu_torture_stall begin holdoff");
schedule_timeout_interruptible(stall_cpu_holdoff * HZ); schedule_timeout_interruptible(stall_cpu_holdoff * HZ);
VERBOSE_PRINTK_STRING("rcu_torture_stall end holdoff"); VERBOSE_TOROUT_STRING("rcu_torture_stall end holdoff");
} }
if (!kthread_should_stop()) { if (!kthread_should_stop()) {
stop_at = get_seconds() + stall_cpu; stop_at = get_seconds() + stall_cpu;
...@@ -1505,7 +1505,7 @@ static void rcu_torture_stall_cleanup(void) ...@@ -1505,7 +1505,7 @@ static void rcu_torture_stall_cleanup(void)
{ {
if (stall_task == NULL) if (stall_task == NULL)
return; return;
VERBOSE_PRINTK_STRING("Stopping rcu_torture_stall_task."); VERBOSE_TOROUT_STRING("Stopping rcu_torture_stall_task.");
kthread_stop(stall_task); kthread_stop(stall_task);
stall_task = NULL; stall_task = NULL;
} }
...@@ -1525,7 +1525,7 @@ static int rcu_torture_barrier_cbs(void *arg) ...@@ -1525,7 +1525,7 @@ static int rcu_torture_barrier_cbs(void *arg)
struct rcu_head rcu; struct rcu_head rcu;
init_rcu_head_on_stack(&rcu); init_rcu_head_on_stack(&rcu);
VERBOSE_PRINTK_STRING("rcu_torture_barrier_cbs task started"); VERBOSE_TOROUT_STRING("rcu_torture_barrier_cbs task started");
set_user_nice(current, 19); set_user_nice(current, 19);
do { do {
wait_event(barrier_cbs_wq[myid], wait_event(barrier_cbs_wq[myid],
...@@ -1541,7 +1541,7 @@ static int rcu_torture_barrier_cbs(void *arg) ...@@ -1541,7 +1541,7 @@ static int rcu_torture_barrier_cbs(void *arg)
if (atomic_dec_and_test(&barrier_cbs_count)) if (atomic_dec_and_test(&barrier_cbs_count))
wake_up(&barrier_wq); wake_up(&barrier_wq);
} while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP);
VERBOSE_PRINTK_STRING("rcu_torture_barrier_cbs task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_barrier_cbs task stopping");
rcutorture_shutdown_absorb("rcu_torture_barrier_cbs"); rcutorture_shutdown_absorb("rcu_torture_barrier_cbs");
while (!kthread_should_stop()) while (!kthread_should_stop())
schedule_timeout_interruptible(1); schedule_timeout_interruptible(1);
...@@ -1555,7 +1555,7 @@ static int rcu_torture_barrier(void *arg) ...@@ -1555,7 +1555,7 @@ static int rcu_torture_barrier(void *arg)
{ {
int i; int i;
VERBOSE_PRINTK_STRING("rcu_torture_barrier task starting"); VERBOSE_TOROUT_STRING("rcu_torture_barrier task starting");
do { do {
atomic_set(&barrier_cbs_invoked, 0); atomic_set(&barrier_cbs_invoked, 0);
atomic_set(&barrier_cbs_count, n_barrier_cbs); atomic_set(&barrier_cbs_count, n_barrier_cbs);
...@@ -1578,7 +1578,7 @@ static int rcu_torture_barrier(void *arg) ...@@ -1578,7 +1578,7 @@ static int rcu_torture_barrier(void *arg)
n_barrier_successes++; n_barrier_successes++;
schedule_timeout_interruptible(HZ / 10); schedule_timeout_interruptible(HZ / 10);
} while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP); } while (!kthread_should_stop() && fullstop == FULLSTOP_DONTSTOP);
VERBOSE_PRINTK_STRING("rcu_torture_barrier task stopping"); VERBOSE_TOROUT_STRING("rcu_torture_barrier task stopping");
rcutorture_shutdown_absorb("rcu_torture_barrier"); rcutorture_shutdown_absorb("rcu_torture_barrier");
while (!kthread_should_stop()) while (!kthread_should_stop())
schedule_timeout_interruptible(1); schedule_timeout_interruptible(1);
...@@ -1619,7 +1619,7 @@ static int rcu_torture_barrier_init(void) ...@@ -1619,7 +1619,7 @@ static int rcu_torture_barrier_init(void)
"rcu_torture_barrier_cbs"); "rcu_torture_barrier_cbs");
if (IS_ERR(barrier_cbs_tasks[i])) { if (IS_ERR(barrier_cbs_tasks[i])) {
ret = PTR_ERR(barrier_cbs_tasks[i]); ret = PTR_ERR(barrier_cbs_tasks[i]);
VERBOSE_PRINTK_ERRSTRING("Failed to create rcu_torture_barrier_cbs"); VERBOSE_TOROUT_ERRSTRING("Failed to create rcu_torture_barrier_cbs");
barrier_cbs_tasks[i] = NULL; barrier_cbs_tasks[i] = NULL;
return ret; return ret;
} }
...@@ -1628,7 +1628,7 @@ static int rcu_torture_barrier_init(void) ...@@ -1628,7 +1628,7 @@ static int rcu_torture_barrier_init(void)
"rcu_torture_barrier"); "rcu_torture_barrier");
if (IS_ERR(barrier_task)) { if (IS_ERR(barrier_task)) {
ret = PTR_ERR(barrier_task); ret = PTR_ERR(barrier_task);
VERBOSE_PRINTK_ERRSTRING("Failed to create rcu_torture_barrier"); VERBOSE_TOROUT_ERRSTRING("Failed to create rcu_torture_barrier");
barrier_task = NULL; barrier_task = NULL;
} }
return 0; return 0;
...@@ -1640,14 +1640,14 @@ static void rcu_torture_barrier_cleanup(void) ...@@ -1640,14 +1640,14 @@ static void rcu_torture_barrier_cleanup(void)
int i; int i;
if (barrier_task != NULL) { if (barrier_task != NULL) {
VERBOSE_PRINTK_STRING("Stopping rcu_torture_barrier task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_barrier task");
kthread_stop(barrier_task); kthread_stop(barrier_task);
barrier_task = NULL; barrier_task = NULL;
} }
if (barrier_cbs_tasks != NULL) { if (barrier_cbs_tasks != NULL) {
for (i = 0; i < n_barrier_cbs; i++) { for (i = 0; i < n_barrier_cbs; i++) {
if (barrier_cbs_tasks[i] != NULL) { if (barrier_cbs_tasks[i] != NULL) {
VERBOSE_PRINTK_STRING("Stopping rcu_torture_barrier_cbs task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_barrier_cbs task");
kthread_stop(barrier_cbs_tasks[i]); kthread_stop(barrier_cbs_tasks[i]);
barrier_cbs_tasks[i] = NULL; barrier_cbs_tasks[i] = NULL;
} }
...@@ -1706,19 +1706,19 @@ rcu_torture_cleanup(void) ...@@ -1706,19 +1706,19 @@ rcu_torture_cleanup(void)
rcu_torture_barrier_cleanup(); rcu_torture_barrier_cleanup();
rcu_torture_stall_cleanup(); rcu_torture_stall_cleanup();
if (stutter_task) { if (stutter_task) {
VERBOSE_PRINTK_STRING("Stopping rcu_torture_stutter task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_stutter task");
kthread_stop(stutter_task); kthread_stop(stutter_task);
} }
stutter_task = NULL; stutter_task = NULL;
if (shuffler_task) { if (shuffler_task) {
VERBOSE_PRINTK_STRING("Stopping rcu_torture_shuffle task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_shuffle task");
kthread_stop(shuffler_task); kthread_stop(shuffler_task);
free_cpumask_var(shuffle_tmp_mask); free_cpumask_var(shuffle_tmp_mask);
} }
shuffler_task = NULL; shuffler_task = NULL;
if (writer_task) { if (writer_task) {
VERBOSE_PRINTK_STRING("Stopping rcu_torture_writer task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_writer task");
kthread_stop(writer_task); kthread_stop(writer_task);
} }
writer_task = NULL; writer_task = NULL;
...@@ -1726,7 +1726,7 @@ rcu_torture_cleanup(void) ...@@ -1726,7 +1726,7 @@ rcu_torture_cleanup(void)
if (reader_tasks) { if (reader_tasks) {
for (i = 0; i < nrealreaders; i++) { for (i = 0; i < nrealreaders; i++) {
if (reader_tasks[i]) { if (reader_tasks[i]) {
VERBOSE_PRINTK_STRING( VERBOSE_TOROUT_STRING(
"Stopping rcu_torture_reader task"); "Stopping rcu_torture_reader task");
kthread_stop(reader_tasks[i]); kthread_stop(reader_tasks[i]);
} }
...@@ -1740,7 +1740,7 @@ rcu_torture_cleanup(void) ...@@ -1740,7 +1740,7 @@ rcu_torture_cleanup(void)
if (fakewriter_tasks) { if (fakewriter_tasks) {
for (i = 0; i < nfakewriters; i++) { for (i = 0; i < nfakewriters; i++) {
if (fakewriter_tasks[i]) { if (fakewriter_tasks[i]) {
VERBOSE_PRINTK_STRING( VERBOSE_TOROUT_STRING(
"Stopping rcu_torture_fakewriter task"); "Stopping rcu_torture_fakewriter task");
kthread_stop(fakewriter_tasks[i]); kthread_stop(fakewriter_tasks[i]);
} }
...@@ -1751,13 +1751,13 @@ rcu_torture_cleanup(void) ...@@ -1751,13 +1751,13 @@ rcu_torture_cleanup(void)
} }
if (stats_task) { if (stats_task) {
VERBOSE_PRINTK_STRING("Stopping rcu_torture_stats task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_stats task");
kthread_stop(stats_task); kthread_stop(stats_task);
} }
stats_task = NULL; stats_task = NULL;
if (fqs_task) { if (fqs_task) {
VERBOSE_PRINTK_STRING("Stopping rcu_torture_fqs task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_fqs task");
kthread_stop(fqs_task); kthread_stop(fqs_task);
} }
fqs_task = NULL; fqs_task = NULL;
...@@ -1768,7 +1768,7 @@ rcu_torture_cleanup(void) ...@@ -1768,7 +1768,7 @@ rcu_torture_cleanup(void)
rcutorture_booster_cleanup(i); rcutorture_booster_cleanup(i);
} }
if (shutdown_task != NULL) { if (shutdown_task != NULL) {
VERBOSE_PRINTK_STRING("Stopping rcu_torture_shutdown task"); VERBOSE_TOROUT_STRING("Stopping rcu_torture_shutdown task");
kthread_stop(shutdown_task); kthread_stop(shutdown_task);
} }
shutdown_task = NULL; shutdown_task = NULL;
...@@ -1924,12 +1924,12 @@ rcu_torture_init(void) ...@@ -1924,12 +1924,12 @@ rcu_torture_init(void)
/* Start up the kthreads. */ /* Start up the kthreads. */
VERBOSE_PRINTK_STRING("Creating rcu_torture_writer task"); VERBOSE_TOROUT_STRING("Creating rcu_torture_writer task");
writer_task = kthread_create(rcu_torture_writer, NULL, writer_task = kthread_create(rcu_torture_writer, NULL,
"rcu_torture_writer"); "rcu_torture_writer");
if (IS_ERR(writer_task)) { if (IS_ERR(writer_task)) {
firsterr = PTR_ERR(writer_task); firsterr = PTR_ERR(writer_task);
VERBOSE_PRINTK_ERRSTRING("Failed to create writer"); VERBOSE_TOROUT_ERRSTRING("Failed to create writer");
writer_task = NULL; writer_task = NULL;
goto unwind; goto unwind;
} }
...@@ -1937,17 +1937,17 @@ rcu_torture_init(void) ...@@ -1937,17 +1937,17 @@ rcu_torture_init(void)
fakewriter_tasks = kzalloc(nfakewriters * sizeof(fakewriter_tasks[0]), fakewriter_tasks = kzalloc(nfakewriters * sizeof(fakewriter_tasks[0]),
GFP_KERNEL); GFP_KERNEL);
if (fakewriter_tasks == NULL) { if (fakewriter_tasks == NULL) {
VERBOSE_PRINTK_ERRSTRING("out of memory"); VERBOSE_TOROUT_ERRSTRING("out of memory");
firsterr = -ENOMEM; firsterr = -ENOMEM;
goto unwind; goto unwind;
} }
for (i = 0; i < nfakewriters; i++) { for (i = 0; i < nfakewriters; i++) {
VERBOSE_PRINTK_STRING("Creating rcu_torture_fakewriter task"); VERBOSE_TOROUT_STRING("Creating rcu_torture_fakewriter task");
fakewriter_tasks[i] = kthread_run(rcu_torture_fakewriter, NULL, fakewriter_tasks[i] = kthread_run(rcu_torture_fakewriter, NULL,
"rcu_torture_fakewriter"); "rcu_torture_fakewriter");
if (IS_ERR(fakewriter_tasks[i])) { if (IS_ERR(fakewriter_tasks[i])) {
firsterr = PTR_ERR(fakewriter_tasks[i]); firsterr = PTR_ERR(fakewriter_tasks[i]);
VERBOSE_PRINTK_ERRSTRING("Failed to create fakewriter"); VERBOSE_TOROUT_ERRSTRING("Failed to create fakewriter");
fakewriter_tasks[i] = NULL; fakewriter_tasks[i] = NULL;
goto unwind; goto unwind;
} }
...@@ -1955,28 +1955,28 @@ rcu_torture_init(void) ...@@ -1955,28 +1955,28 @@ rcu_torture_init(void)
reader_tasks = kzalloc(nrealreaders * sizeof(reader_tasks[0]), reader_tasks = kzalloc(nrealreaders * sizeof(reader_tasks[0]),
GFP_KERNEL); GFP_KERNEL);
if (reader_tasks == NULL) { if (reader_tasks == NULL) {
VERBOSE_PRINTK_ERRSTRING("out of memory"); VERBOSE_TOROUT_ERRSTRING("out of memory");
firsterr = -ENOMEM; firsterr = -ENOMEM;
goto unwind; goto unwind;
} }
for (i = 0; i < nrealreaders; i++) { for (i = 0; i < nrealreaders; i++) {
VERBOSE_PRINTK_STRING("Creating rcu_torture_reader task"); VERBOSE_TOROUT_STRING("Creating rcu_torture_reader task");
reader_tasks[i] = kthread_run(rcu_torture_reader, NULL, reader_tasks[i] = kthread_run(rcu_torture_reader, NULL,
"rcu_torture_reader"); "rcu_torture_reader");
if (IS_ERR(reader_tasks[i])) { if (IS_ERR(reader_tasks[i])) {
firsterr = PTR_ERR(reader_tasks[i]); firsterr = PTR_ERR(reader_tasks[i]);
VERBOSE_PRINTK_ERRSTRING("Failed to create reader"); VERBOSE_TOROUT_ERRSTRING("Failed to create reader");
reader_tasks[i] = NULL; reader_tasks[i] = NULL;
goto unwind; goto unwind;
} }
} }
if (stat_interval > 0) { if (stat_interval > 0) {
VERBOSE_PRINTK_STRING("Creating rcu_torture_stats task"); VERBOSE_TOROUT_STRING("Creating rcu_torture_stats task");
stats_task = kthread_run(rcu_torture_stats, NULL, stats_task = kthread_run(rcu_torture_stats, NULL,
"rcu_torture_stats"); "rcu_torture_stats");
if (IS_ERR(stats_task)) { if (IS_ERR(stats_task)) {
firsterr = PTR_ERR(stats_task); firsterr = PTR_ERR(stats_task);
VERBOSE_PRINTK_ERRSTRING("Failed to create stats"); VERBOSE_TOROUT_ERRSTRING("Failed to create stats");
stats_task = NULL; stats_task = NULL;
goto unwind; goto unwind;
} }
...@@ -1986,7 +1986,7 @@ rcu_torture_init(void) ...@@ -1986,7 +1986,7 @@ rcu_torture_init(void)
if (!alloc_cpumask_var(&shuffle_tmp_mask, GFP_KERNEL)) { if (!alloc_cpumask_var(&shuffle_tmp_mask, GFP_KERNEL)) {
firsterr = -ENOMEM; firsterr = -ENOMEM;
VERBOSE_PRINTK_ERRSTRING("Failed to alloc mask"); VERBOSE_TOROUT_ERRSTRING("Failed to alloc mask");
goto unwind; goto unwind;
} }
...@@ -1996,7 +1996,7 @@ rcu_torture_init(void) ...@@ -1996,7 +1996,7 @@ rcu_torture_init(void)
if (IS_ERR(shuffler_task)) { if (IS_ERR(shuffler_task)) {
free_cpumask_var(shuffle_tmp_mask); free_cpumask_var(shuffle_tmp_mask);
firsterr = PTR_ERR(shuffler_task); firsterr = PTR_ERR(shuffler_task);
VERBOSE_PRINTK_ERRSTRING("Failed to create shuffler"); VERBOSE_TOROUT_ERRSTRING("Failed to create shuffler");
shuffler_task = NULL; shuffler_task = NULL;
goto unwind; goto unwind;
} }
...@@ -2009,7 +2009,7 @@ rcu_torture_init(void) ...@@ -2009,7 +2009,7 @@ rcu_torture_init(void)
"rcu_torture_stutter"); "rcu_torture_stutter");
if (IS_ERR(stutter_task)) { if (IS_ERR(stutter_task)) {
firsterr = PTR_ERR(stutter_task); firsterr = PTR_ERR(stutter_task);
VERBOSE_PRINTK_ERRSTRING("Failed to create stutter"); VERBOSE_TOROUT_ERRSTRING("Failed to create stutter");
stutter_task = NULL; stutter_task = NULL;
goto unwind; goto unwind;
} }
...@@ -2022,7 +2022,7 @@ rcu_torture_init(void) ...@@ -2022,7 +2022,7 @@ rcu_torture_init(void)
"rcu_torture_fqs"); "rcu_torture_fqs");
if (IS_ERR(fqs_task)) { if (IS_ERR(fqs_task)) {
firsterr = PTR_ERR(fqs_task); firsterr = PTR_ERR(fqs_task);
VERBOSE_PRINTK_ERRSTRING("Failed to create fqs"); VERBOSE_TOROUT_ERRSTRING("Failed to create fqs");
fqs_task = NULL; fqs_task = NULL;
goto unwind; goto unwind;
} }
...@@ -2052,7 +2052,7 @@ rcu_torture_init(void) ...@@ -2052,7 +2052,7 @@ rcu_torture_init(void)
"rcu_torture_shutdown"); "rcu_torture_shutdown");
if (IS_ERR(shutdown_task)) { if (IS_ERR(shutdown_task)) {
firsterr = PTR_ERR(shutdown_task); firsterr = PTR_ERR(shutdown_task);
VERBOSE_PRINTK_ERRSTRING("Failed to create shutdown"); VERBOSE_TOROUT_ERRSTRING("Failed to create shutdown");
shutdown_task = NULL; shutdown_task = NULL;
goto unwind; goto unwind;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册