[PATCH] fix kernel-doc in kernel/ dir
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / rcutorture.c
CommitLineData
a241ec65
PM
1/*
2 * Read-Copy Update /proc-based torture test facility
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright (C) IBM Corporation, 2005
19 *
20 * Authors: Paul E. McKenney <paulmck@us.ibm.com>
21 *
22 * See also: Documentation/RCU/torture.txt
23 */
24#include <linux/types.h>
25#include <linux/kernel.h>
26#include <linux/init.h>
27#include <linux/module.h>
28#include <linux/kthread.h>
29#include <linux/err.h>
30#include <linux/spinlock.h>
31#include <linux/smp.h>
32#include <linux/rcupdate.h>
33#include <linux/interrupt.h>
34#include <linux/sched.h>
35#include <asm/atomic.h>
36#include <linux/bitops.h>
37#include <linux/module.h>
38#include <linux/completion.h>
39#include <linux/moduleparam.h>
40#include <linux/percpu.h>
41#include <linux/notifier.h>
a241ec65
PM
42#include <linux/cpu.h>
43#include <linux/random.h>
44#include <linux/delay.h>
45#include <linux/byteorder/swabb.h>
46#include <linux/stat.h>
47
48MODULE_LICENSE("GPL");
49
50static int nreaders = -1; /* # reader threads, defaults to 4*ncpus */
d84f5203 51static int stat_interval; /* Interval between stats, in seconds. */
a241ec65 52 /* Defaults to "only at end of test". */
d84f5203
SV
53static int verbose; /* Print more debug info. */
54static int test_no_idle_hz; /* Test RCU's support for tickless idle CPUs. */
55static int shuffle_interval = 5; /* Interval between shuffles (in sec)*/
a241ec65 56
8d3b33f6 57module_param(nreaders, int, 0);
a241ec65 58MODULE_PARM_DESC(nreaders, "Number of RCU reader threads");
8d3b33f6 59module_param(stat_interval, int, 0);
a241ec65 60MODULE_PARM_DESC(stat_interval, "Number of seconds between stats printk()s");
8d3b33f6 61module_param(verbose, bool, 0);
a241ec65 62MODULE_PARM_DESC(verbose, "Enable verbose debugging printk()s");
8d3b33f6 63module_param(test_no_idle_hz, bool, 0);
d84f5203 64MODULE_PARM_DESC(test_no_idle_hz, "Test support for tickless idle CPUs");
8d3b33f6 65module_param(shuffle_interval, int, 0);
d84f5203 66MODULE_PARM_DESC(shuffle_interval, "Number of seconds between shuffles");
a241ec65
PM
67#define TORTURE_FLAG "rcutorture: "
68#define PRINTK_STRING(s) \
69 do { printk(KERN_ALERT TORTURE_FLAG s "\n"); } while (0)
70#define VERBOSE_PRINTK_STRING(s) \
71 do { if (verbose) printk(KERN_ALERT TORTURE_FLAG s "\n"); } while (0)
72#define VERBOSE_PRINTK_ERRSTRING(s) \
73 do { if (verbose) printk(KERN_ALERT TORTURE_FLAG "!!! " s "\n"); } while (0)
74
75static char printk_buf[4096];
76
77static int nrealreaders;
78static struct task_struct *writer_task;
79static struct task_struct **reader_tasks;
80static struct task_struct *stats_task;
d84f5203 81static struct task_struct *shuffler_task;
a241ec65
PM
82
83#define RCU_TORTURE_PIPE_LEN 10
84
85struct rcu_torture {
86 struct rcu_head rtort_rcu;
87 int rtort_pipe_count;
88 struct list_head rtort_free;
996417d2 89 int rtort_mbtest;
a241ec65
PM
90};
91
92static int fullstop = 0; /* stop generating callbacks at test end. */
93static LIST_HEAD(rcu_torture_freelist);
94static struct rcu_torture *rcu_torture_current = NULL;
95static long rcu_torture_current_version = 0;
96static struct rcu_torture rcu_tortures[10 * RCU_TORTURE_PIPE_LEN];
97static DEFINE_SPINLOCK(rcu_torture_lock);
98static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_count) =
99 { 0 };
100static DEFINE_PER_CPU(long [RCU_TORTURE_PIPE_LEN + 1], rcu_torture_batch) =
101 { 0 };
102static atomic_t rcu_torture_wcount[RCU_TORTURE_PIPE_LEN + 1];
103atomic_t n_rcu_torture_alloc;
104atomic_t n_rcu_torture_alloc_fail;
105atomic_t n_rcu_torture_free;
996417d2
PM
106atomic_t n_rcu_torture_mberror;
107atomic_t n_rcu_torture_error;
a241ec65
PM
108
109/*
110 * Allocate an element from the rcu_tortures pool.
111 */
97a41e26 112static struct rcu_torture *
a241ec65
PM
113rcu_torture_alloc(void)
114{
115 struct list_head *p;
116
adac1665 117 spin_lock_bh(&rcu_torture_lock);
a241ec65
PM
118 if (list_empty(&rcu_torture_freelist)) {
119 atomic_inc(&n_rcu_torture_alloc_fail);
adac1665 120 spin_unlock_bh(&rcu_torture_lock);
a241ec65
PM
121 return NULL;
122 }
123 atomic_inc(&n_rcu_torture_alloc);
124 p = rcu_torture_freelist.next;
125 list_del_init(p);
adac1665 126 spin_unlock_bh(&rcu_torture_lock);
a241ec65
PM
127 return container_of(p, struct rcu_torture, rtort_free);
128}
129
130/*
131 * Free an element to the rcu_tortures pool.
132 */
133static void
134rcu_torture_free(struct rcu_torture *p)
135{
136 atomic_inc(&n_rcu_torture_free);
adac1665 137 spin_lock_bh(&rcu_torture_lock);
a241ec65 138 list_add_tail(&p->rtort_free, &rcu_torture_freelist);
adac1665 139 spin_unlock_bh(&rcu_torture_lock);
a241ec65
PM
140}
141
142static void
143rcu_torture_cb(struct rcu_head *p)
144{
145 int i;
146 struct rcu_torture *rp = container_of(p, struct rcu_torture, rtort_rcu);
147
148 if (fullstop) {
149 /* Test is ending, just drop callbacks on the floor. */
150 /* The next initialization will pick up the pieces. */
151 return;
152 }
153 i = rp->rtort_pipe_count;
154 if (i > RCU_TORTURE_PIPE_LEN)
155 i = RCU_TORTURE_PIPE_LEN;
156 atomic_inc(&rcu_torture_wcount[i]);
996417d2
PM
157 if (++rp->rtort_pipe_count >= RCU_TORTURE_PIPE_LEN) {
158 rp->rtort_mbtest = 0;
a241ec65 159 rcu_torture_free(rp);
996417d2 160 } else
a241ec65
PM
161 call_rcu(p, rcu_torture_cb);
162}
163
164struct rcu_random_state {
165 unsigned long rrs_state;
166 unsigned long rrs_count;
167};
168
169#define RCU_RANDOM_MULT 39916801 /* prime */
170#define RCU_RANDOM_ADD 479001701 /* prime */
171#define RCU_RANDOM_REFRESH 10000
172
173#define DEFINE_RCU_RANDOM(name) struct rcu_random_state name = { 0, 0 }
174
175/*
176 * Crude but fast random-number generator. Uses a linear congruential
177 * generator, with occasional help from get_random_bytes().
178 */
179static long
180rcu_random(struct rcu_random_state *rrsp)
181{
182 long refresh;
183
184 if (--rrsp->rrs_count < 0) {
185 get_random_bytes(&refresh, sizeof(refresh));
186 rrsp->rrs_state += refresh;
187 rrsp->rrs_count = RCU_RANDOM_REFRESH;
188 }
189 rrsp->rrs_state = rrsp->rrs_state * RCU_RANDOM_MULT + RCU_RANDOM_ADD;
190 return swahw32(rrsp->rrs_state);
191}
192
193/*
194 * RCU torture writer kthread. Repeatedly substitutes a new structure
195 * for that pointed to by rcu_torture_current, freeing the old structure
196 * after a series of grace periods (the "pipeline").
197 */
198static int
199rcu_torture_writer(void *arg)
200{
201 int i;
202 long oldbatch = rcu_batches_completed();
203 struct rcu_torture *rp;
204 struct rcu_torture *old_rp;
205 static DEFINE_RCU_RANDOM(rand);
206
207 VERBOSE_PRINTK_STRING("rcu_torture_writer task started");
dbdf65b1
IM
208 set_user_nice(current, 19);
209
a241ec65
PM
210 do {
211 schedule_timeout_uninterruptible(1);
212 if (rcu_batches_completed() == oldbatch)
213 continue;
214 if ((rp = rcu_torture_alloc()) == NULL)
215 continue;
216 rp->rtort_pipe_count = 0;
217 udelay(rcu_random(&rand) & 0x3ff);
218 old_rp = rcu_torture_current;
996417d2 219 rp->rtort_mbtest = 1;
a241ec65
PM
220 rcu_assign_pointer(rcu_torture_current, rp);
221 smp_wmb();
222 if (old_rp != NULL) {
223 i = old_rp->rtort_pipe_count;
224 if (i > RCU_TORTURE_PIPE_LEN)
225 i = RCU_TORTURE_PIPE_LEN;
226 atomic_inc(&rcu_torture_wcount[i]);
227 old_rp->rtort_pipe_count++;
228 call_rcu(&old_rp->rtort_rcu, rcu_torture_cb);
229 }
230 rcu_torture_current_version++;
231 oldbatch = rcu_batches_completed();
232 } while (!kthread_should_stop() && !fullstop);
233 VERBOSE_PRINTK_STRING("rcu_torture_writer task stopping");
234 while (!kthread_should_stop())
235 schedule_timeout_uninterruptible(1);
236 return 0;
237}
238
239/*
240 * RCU torture reader kthread. Repeatedly dereferences rcu_torture_current,
241 * incrementing the corresponding element of the pipeline array. The
242 * counter in the element should never be greater than 1, otherwise, the
243 * RCU implementation is broken.
244 */
245static int
246rcu_torture_reader(void *arg)
247{
248 int completed;
249 DEFINE_RCU_RANDOM(rand);
250 struct rcu_torture *p;
251 int pipe_count;
252
253 VERBOSE_PRINTK_STRING("rcu_torture_reader task started");
dbdf65b1
IM
254 set_user_nice(current, 19);
255
a241ec65
PM
256 do {
257 rcu_read_lock();
258 completed = rcu_batches_completed();
259 p = rcu_dereference(rcu_torture_current);
260 if (p == NULL) {
261 /* Wait for rcu_torture_writer to get underway */
262 rcu_read_unlock();
263 schedule_timeout_interruptible(HZ);
264 continue;
265 }
996417d2
PM
266 if (p->rtort_mbtest == 0)
267 atomic_inc(&n_rcu_torture_mberror);
a241ec65
PM
268 udelay(rcu_random(&rand) & 0x7f);
269 preempt_disable();
270 pipe_count = p->rtort_pipe_count;
271 if (pipe_count > RCU_TORTURE_PIPE_LEN) {
272 /* Should not happen, but... */
273 pipe_count = RCU_TORTURE_PIPE_LEN;
274 }
275 ++__get_cpu_var(rcu_torture_count)[pipe_count];
276 completed = rcu_batches_completed() - completed;
277 if (completed > RCU_TORTURE_PIPE_LEN) {
278 /* Should not happen, but... */
279 completed = RCU_TORTURE_PIPE_LEN;
280 }
281 ++__get_cpu_var(rcu_torture_batch)[completed];
282 preempt_enable();
283 rcu_read_unlock();
284 schedule();
285 } while (!kthread_should_stop() && !fullstop);
286 VERBOSE_PRINTK_STRING("rcu_torture_reader task stopping");
287 while (!kthread_should_stop())
288 schedule_timeout_uninterruptible(1);
289 return 0;
290}
291
292/*
293 * Create an RCU-torture statistics message in the specified buffer.
294 */
295static int
296rcu_torture_printk(char *page)
297{
298 int cnt = 0;
299 int cpu;
300 int i;
301 long pipesummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
302 long batchsummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
303
0a945022 304 for_each_possible_cpu(cpu) {
a241ec65
PM
305 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
306 pipesummary[i] += per_cpu(rcu_torture_count, cpu)[i];
307 batchsummary[i] += per_cpu(rcu_torture_batch, cpu)[i];
308 }
309 }
310 for (i = RCU_TORTURE_PIPE_LEN - 1; i >= 0; i--) {
311 if (pipesummary[i] != 0)
312 break;
313 }
314 cnt += sprintf(&page[cnt], "rcutorture: ");
315 cnt += sprintf(&page[cnt],
996417d2
PM
316 "rtc: %p ver: %ld tfle: %d rta: %d rtaf: %d rtf: %d "
317 "rtmbe: %d",
a241ec65
PM
318 rcu_torture_current,
319 rcu_torture_current_version,
320 list_empty(&rcu_torture_freelist),
321 atomic_read(&n_rcu_torture_alloc),
322 atomic_read(&n_rcu_torture_alloc_fail),
996417d2
PM
323 atomic_read(&n_rcu_torture_free),
324 atomic_read(&n_rcu_torture_mberror));
325 if (atomic_read(&n_rcu_torture_mberror) != 0)
326 cnt += sprintf(&page[cnt], " !!!");
a241ec65 327 cnt += sprintf(&page[cnt], "\nrcutorture: ");
996417d2 328 if (i > 1) {
a241ec65 329 cnt += sprintf(&page[cnt], "!!! ");
996417d2
PM
330 atomic_inc(&n_rcu_torture_error);
331 }
a241ec65
PM
332 cnt += sprintf(&page[cnt], "Reader Pipe: ");
333 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++)
334 cnt += sprintf(&page[cnt], " %ld", pipesummary[i]);
335 cnt += sprintf(&page[cnt], "\nrcutorture: ");
336 cnt += sprintf(&page[cnt], "Reader Batch: ");
337 for (i = 0; i < RCU_TORTURE_PIPE_LEN; i++)
338 cnt += sprintf(&page[cnt], " %ld", batchsummary[i]);
339 cnt += sprintf(&page[cnt], "\nrcutorture: ");
340 cnt += sprintf(&page[cnt], "Free-Block Circulation: ");
341 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
342 cnt += sprintf(&page[cnt], " %d",
343 atomic_read(&rcu_torture_wcount[i]));
344 }
345 cnt += sprintf(&page[cnt], "\n");
346 return cnt;
347}
348
349/*
350 * Print torture statistics. Caller must ensure that there is only
351 * one call to this function at a given time!!! This is normally
352 * accomplished by relying on the module system to only have one copy
353 * of the module loaded, and then by giving the rcu_torture_stats
354 * kthread full control (or the init/cleanup functions when rcu_torture_stats
355 * thread is not running).
356 */
357static void
358rcu_torture_stats_print(void)
359{
360 int cnt;
361
362 cnt = rcu_torture_printk(printk_buf);
363 printk(KERN_ALERT "%s", printk_buf);
364}
365
366/*
367 * Periodically prints torture statistics, if periodic statistics printing
368 * was specified via the stat_interval module parameter.
369 *
370 * No need to worry about fullstop here, since this one doesn't reference
371 * volatile state or register callbacks.
372 */
373static int
374rcu_torture_stats(void *arg)
375{
376 VERBOSE_PRINTK_STRING("rcu_torture_stats task started");
377 do {
378 schedule_timeout_interruptible(stat_interval * HZ);
379 rcu_torture_stats_print();
380 } while (!kthread_should_stop());
381 VERBOSE_PRINTK_STRING("rcu_torture_stats task stopping");
382 return 0;
383}
384
d84f5203
SV
385static int rcu_idle_cpu; /* Force all torture tasks off this CPU */
386
387/* Shuffle tasks such that we allow @rcu_idle_cpu to become idle. A special case
388 * is when @rcu_idle_cpu = -1, when we allow the tasks to run on all CPUs.
389 */
390void rcu_torture_shuffle_tasks(void)
391{
392 cpumask_t tmp_mask = CPU_MASK_ALL;
393 int i;
394
395 lock_cpu_hotplug();
396
397 /* No point in shuffling if there is only one online CPU (ex: UP) */
398 if (num_online_cpus() == 1) {
399 unlock_cpu_hotplug();
400 return;
401 }
402
403 if (rcu_idle_cpu != -1)
404 cpu_clear(rcu_idle_cpu, tmp_mask);
405
406 set_cpus_allowed(current, tmp_mask);
407
408 if (reader_tasks != NULL) {
409 for (i = 0; i < nrealreaders; i++)
410 if (reader_tasks[i])
411 set_cpus_allowed(reader_tasks[i], tmp_mask);
412 }
413
414 if (writer_task)
415 set_cpus_allowed(writer_task, tmp_mask);
416
417 if (stats_task)
418 set_cpus_allowed(stats_task, tmp_mask);
419
420 if (rcu_idle_cpu == -1)
421 rcu_idle_cpu = num_online_cpus() - 1;
422 else
423 rcu_idle_cpu--;
424
425 unlock_cpu_hotplug();
426}
427
428/* Shuffle tasks across CPUs, with the intent of allowing each CPU in the
429 * system to become idle at a time and cut off its timer ticks. This is meant
430 * to test the support for such tickless idle CPU in RCU.
431 */
432static int
433rcu_torture_shuffle(void *arg)
434{
435 VERBOSE_PRINTK_STRING("rcu_torture_shuffle task started");
436 do {
437 schedule_timeout_interruptible(shuffle_interval * HZ);
438 rcu_torture_shuffle_tasks();
439 } while (!kthread_should_stop());
440 VERBOSE_PRINTK_STRING("rcu_torture_shuffle task stopping");
441 return 0;
442}
443
95c38322
PM
444static inline void
445rcu_torture_print_module_parms(char *tag)
446{
447 printk(KERN_ALERT TORTURE_FLAG "--- %s: nreaders=%d "
448 "stat_interval=%d verbose=%d test_no_idle_hz=%d "
449 "shuffle_interval = %d\n",
450 tag, nrealreaders, stat_interval, verbose, test_no_idle_hz,
451 shuffle_interval);
452}
453
a241ec65
PM
454static void
455rcu_torture_cleanup(void)
456{
457 int i;
458
459 fullstop = 1;
d84f5203
SV
460 if (shuffler_task != NULL) {
461 VERBOSE_PRINTK_STRING("Stopping rcu_torture_shuffle task");
462 kthread_stop(shuffler_task);
463 }
464 shuffler_task = NULL;
465
a241ec65
PM
466 if (writer_task != NULL) {
467 VERBOSE_PRINTK_STRING("Stopping rcu_torture_writer task");
468 kthread_stop(writer_task);
469 }
470 writer_task = NULL;
471
472 if (reader_tasks != NULL) {
473 for (i = 0; i < nrealreaders; i++) {
474 if (reader_tasks[i] != NULL) {
475 VERBOSE_PRINTK_STRING(
476 "Stopping rcu_torture_reader task");
477 kthread_stop(reader_tasks[i]);
478 }
479 reader_tasks[i] = NULL;
480 }
481 kfree(reader_tasks);
482 reader_tasks = NULL;
483 }
484 rcu_torture_current = NULL;
485
486 if (stats_task != NULL) {
487 VERBOSE_PRINTK_STRING("Stopping rcu_torture_stats task");
488 kthread_stop(stats_task);
489 }
490 stats_task = NULL;
491
492 /* Wait for all RCU callbacks to fire. */
89d46b87 493 rcu_barrier();
a241ec65 494
a241ec65 495 rcu_torture_stats_print(); /* -After- the stats thread is stopped! */
95c38322
PM
496 if (atomic_read(&n_rcu_torture_error))
497 rcu_torture_print_module_parms("End of test: FAILURE");
498 else
499 rcu_torture_print_module_parms("End of test: SUCCESS");
a241ec65
PM
500}
501
502static int
503rcu_torture_init(void)
504{
505 int i;
506 int cpu;
507 int firsterr = 0;
508
509 /* Process args and tell the world that the torturer is on the job. */
510
511 if (nreaders >= 0)
512 nrealreaders = nreaders;
513 else
514 nrealreaders = 2 * num_online_cpus();
95c38322 515 rcu_torture_print_module_parms("Start of test");
a241ec65
PM
516 fullstop = 0;
517
518 /* Set up the freelist. */
519
520 INIT_LIST_HEAD(&rcu_torture_freelist);
521 for (i = 0; i < sizeof(rcu_tortures) / sizeof(rcu_tortures[0]); i++) {
996417d2 522 rcu_tortures[i].rtort_mbtest = 0;
a241ec65
PM
523 list_add_tail(&rcu_tortures[i].rtort_free,
524 &rcu_torture_freelist);
525 }
526
527 /* Initialize the statistics so that each run gets its own numbers. */
528
529 rcu_torture_current = NULL;
530 rcu_torture_current_version = 0;
531 atomic_set(&n_rcu_torture_alloc, 0);
532 atomic_set(&n_rcu_torture_alloc_fail, 0);
533 atomic_set(&n_rcu_torture_free, 0);
996417d2
PM
534 atomic_set(&n_rcu_torture_mberror, 0);
535 atomic_set(&n_rcu_torture_error, 0);
a241ec65
PM
536 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++)
537 atomic_set(&rcu_torture_wcount[i], 0);
0a945022 538 for_each_possible_cpu(cpu) {
a241ec65
PM
539 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
540 per_cpu(rcu_torture_count, cpu)[i] = 0;
541 per_cpu(rcu_torture_batch, cpu)[i] = 0;
542 }
543 }
544
545 /* Start up the kthreads. */
546
547 VERBOSE_PRINTK_STRING("Creating rcu_torture_writer task");
548 writer_task = kthread_run(rcu_torture_writer, NULL,
549 "rcu_torture_writer");
550 if (IS_ERR(writer_task)) {
551 firsterr = PTR_ERR(writer_task);
552 VERBOSE_PRINTK_ERRSTRING("Failed to create writer");
553 writer_task = NULL;
554 goto unwind;
555 }
556 reader_tasks = kmalloc(nrealreaders * sizeof(reader_tasks[0]),
557 GFP_KERNEL);
558 if (reader_tasks == NULL) {
559 VERBOSE_PRINTK_ERRSTRING("out of memory");
560 firsterr = -ENOMEM;
561 goto unwind;
562 }
563 for (i = 0; i < nrealreaders; i++) {
564 VERBOSE_PRINTK_STRING("Creating rcu_torture_reader task");
565 reader_tasks[i] = kthread_run(rcu_torture_reader, NULL,
566 "rcu_torture_reader");
567 if (IS_ERR(reader_tasks[i])) {
568 firsterr = PTR_ERR(reader_tasks[i]);
569 VERBOSE_PRINTK_ERRSTRING("Failed to create reader");
570 reader_tasks[i] = NULL;
571 goto unwind;
572 }
573 }
574 if (stat_interval > 0) {
575 VERBOSE_PRINTK_STRING("Creating rcu_torture_stats task");
576 stats_task = kthread_run(rcu_torture_stats, NULL,
577 "rcu_torture_stats");
578 if (IS_ERR(stats_task)) {
579 firsterr = PTR_ERR(stats_task);
580 VERBOSE_PRINTK_ERRSTRING("Failed to create stats");
581 stats_task = NULL;
582 goto unwind;
583 }
584 }
d84f5203
SV
585 if (test_no_idle_hz) {
586 rcu_idle_cpu = num_online_cpus() - 1;
587 /* Create the shuffler thread */
588 shuffler_task = kthread_run(rcu_torture_shuffle, NULL,
589 "rcu_torture_shuffle");
590 if (IS_ERR(shuffler_task)) {
591 firsterr = PTR_ERR(shuffler_task);
592 VERBOSE_PRINTK_ERRSTRING("Failed to create shuffler");
593 shuffler_task = NULL;
594 goto unwind;
595 }
596 }
a241ec65
PM
597 return 0;
598
599unwind:
600 rcu_torture_cleanup();
601 return firsterr;
602}
603
604module_init(rcu_torture_init);
605module_exit(rcu_torture_cleanup);