Commit 3dbe43f6 authored by Paul E. McKenney's avatar Paul E. McKenney

Merge branches 'doc.2015.07.15a' and 'torture.2015.07.15a' into HEAD

doc.2015.07.15a: Documentation updates.
torture.2015.07.15a: Torture-test updates.
...@@ -28,7 +28,7 @@ o You must use one of the rcu_dereference() family of primitives ...@@ -28,7 +28,7 @@ o You must use one of the rcu_dereference() family of primitives
o Avoid cancellation when using the "+" and "-" infix arithmetic o Avoid cancellation when using the "+" and "-" infix arithmetic
operators. For example, for a given variable "x", avoid operators. For example, for a given variable "x", avoid
"(x-x)". There are similar arithmetic pitfalls from other "(x-x)". There are similar arithmetic pitfalls from other
arithmetic operatiors, such as "(x*0)", "(x/(x+1))" or "(x%1)". arithmetic operators, such as "(x*0)", "(x/(x+1))" or "(x%1)".
The compiler is within its rights to substitute zero for all of The compiler is within its rights to substitute zero for all of
these expressions, so that subsequent accesses no longer depend these expressions, so that subsequent accesses no longer depend
on the rcu_dereference(), again possibly resulting in bugs due on the rcu_dereference(), again possibly resulting in bugs due
......
...@@ -3135,22 +3135,35 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -3135,22 +3135,35 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
in a given burst of a callback-flood test. in a given burst of a callback-flood test.
rcutorture.fqs_duration= [KNL] rcutorture.fqs_duration= [KNL]
Set duration of force_quiescent_state bursts. Set duration of force_quiescent_state bursts
in microseconds.
rcutorture.fqs_holdoff= [KNL] rcutorture.fqs_holdoff= [KNL]
Set holdoff time within force_quiescent_state bursts. Set holdoff time within force_quiescent_state bursts
in microseconds.
rcutorture.fqs_stutter= [KNL] rcutorture.fqs_stutter= [KNL]
Set wait time between force_quiescent_state bursts. Set wait time between force_quiescent_state bursts
in seconds.
rcutorture.gp_cond= [KNL]
Use conditional/asynchronous update-side
primitives, if available.
rcutorture.gp_exp= [KNL] rcutorture.gp_exp= [KNL]
Use expedited update-side primitives. Use expedited update-side primitives, if available.
rcutorture.gp_normal= [KNL] rcutorture.gp_normal= [KNL]
Use normal (non-expedited) update-side primitives. Use normal (non-expedited) asynchronous
If both gp_exp and gp_normal are set, do both. update-side primitives, if available.
If neither gp_exp nor gp_normal are set, still
do both. rcutorture.gp_sync= [KNL]
Use normal (non-expedited) synchronous
update-side primitives, if available. If all
of rcutorture.gp_cond=, rcutorture.gp_exp=,
rcutorture.gp_normal=, and rcutorture.gp_sync=
are zero, rcutorture acts as if is interpreted
they are all non-zero.
rcutorture.n_barrier_cbs= [KNL] rcutorture.n_barrier_cbs= [KNL]
Set callbacks/threads for rcu_barrier() testing. Set callbacks/threads for rcu_barrier() testing.
...@@ -3177,9 +3190,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -3177,9 +3190,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Set time (s) between CPU-hotplug operations, or Set time (s) between CPU-hotplug operations, or
zero to disable CPU-hotplug testing. zero to disable CPU-hotplug testing.
rcutorture.torture_runnable= [BOOT]
Start rcutorture running at boot time.
rcutorture.shuffle_interval= [KNL] rcutorture.shuffle_interval= [KNL]
Set task-shuffle interval (s). Shuffling tasks Set task-shuffle interval (s). Shuffling tasks
allows some CPUs to go into dyntick-idle mode allows some CPUs to go into dyntick-idle mode
...@@ -3220,6 +3230,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. ...@@ -3220,6 +3230,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
Test RCU's dyntick-idle handling. See also the Test RCU's dyntick-idle handling. See also the
rcutorture.shuffle_interval parameter. rcutorture.shuffle_interval parameter.
rcutorture.torture_runnable= [BOOT]
Start rcutorture running at boot time.
rcutorture.torture_type= [KNL] rcutorture.torture_type= [KNL]
Specify the RCU implementation to test. Specify the RCU implementation to test.
......
This diff is collapsed.
...@@ -686,10 +686,20 @@ static struct rcu_torture_ops tasks_ops = { ...@@ -686,10 +686,20 @@ static struct rcu_torture_ops tasks_ops = {
#define RCUTORTURE_TASKS_OPS &tasks_ops, #define RCUTORTURE_TASKS_OPS &tasks_ops,
static bool __maybe_unused torturing_tasks(void)
{
return cur_ops == &tasks_ops;
}
#else /* #ifdef CONFIG_TASKS_RCU */ #else /* #ifdef CONFIG_TASKS_RCU */
#define RCUTORTURE_TASKS_OPS #define RCUTORTURE_TASKS_OPS
static bool torturing_tasks(void)
{
return false;
}
#endif /* #else #ifdef CONFIG_TASKS_RCU */ #endif /* #else #ifdef CONFIG_TASKS_RCU */
/* /*
...@@ -825,9 +835,7 @@ rcu_torture_cbflood(void *arg) ...@@ -825,9 +835,7 @@ rcu_torture_cbflood(void *arg)
} }
if (err) { if (err) {
VERBOSE_TOROUT_STRING("rcu_torture_cbflood disabled: Bad args or OOM"); VERBOSE_TOROUT_STRING("rcu_torture_cbflood disabled: Bad args or OOM");
while (!torture_must_stop()) goto wait_for_stop;
schedule_timeout_interruptible(HZ);
return 0;
} }
VERBOSE_TOROUT_STRING("rcu_torture_cbflood task started"); VERBOSE_TOROUT_STRING("rcu_torture_cbflood task started");
do { do {
...@@ -846,6 +854,7 @@ rcu_torture_cbflood(void *arg) ...@@ -846,6 +854,7 @@ rcu_torture_cbflood(void *arg)
stutter_wait("rcu_torture_cbflood"); stutter_wait("rcu_torture_cbflood");
} while (!torture_must_stop()); } while (!torture_must_stop());
vfree(rhp); vfree(rhp);
wait_for_stop:
torture_kthread_stopping("rcu_torture_cbflood"); torture_kthread_stopping("rcu_torture_cbflood");
return 0; return 0;
} }
...@@ -1090,7 +1099,8 @@ static void rcu_torture_timer(unsigned long unused) ...@@ -1090,7 +1099,8 @@ static void rcu_torture_timer(unsigned long unused)
p = rcu_dereference_check(rcu_torture_current, p = rcu_dereference_check(rcu_torture_current,
rcu_read_lock_bh_held() || rcu_read_lock_bh_held() ||
rcu_read_lock_sched_held() || rcu_read_lock_sched_held() ||
srcu_read_lock_held(srcu_ctlp)); srcu_read_lock_held(srcu_ctlp) ||
torturing_tasks());
if (p == NULL) { if (p == NULL) {
/* Leave because rcu_torture_writer is not yet underway */ /* Leave because rcu_torture_writer is not yet underway */
cur_ops->readunlock(idx); cur_ops->readunlock(idx);
...@@ -1164,7 +1174,8 @@ rcu_torture_reader(void *arg) ...@@ -1164,7 +1174,8 @@ rcu_torture_reader(void *arg)
p = rcu_dereference_check(rcu_torture_current, p = rcu_dereference_check(rcu_torture_current,
rcu_read_lock_bh_held() || rcu_read_lock_bh_held() ||
rcu_read_lock_sched_held() || rcu_read_lock_sched_held() ||
srcu_read_lock_held(srcu_ctlp)); srcu_read_lock_held(srcu_ctlp) ||
torturing_tasks());
if (p == NULL) { if (p == NULL) {
/* Wait for rcu_torture_writer to get underway */ /* Wait for rcu_torture_writer to get underway */
cur_ops->readunlock(idx); cur_ops->readunlock(idx);
...@@ -1509,7 +1520,7 @@ static int rcu_torture_barrier_init(void) ...@@ -1509,7 +1520,7 @@ static int rcu_torture_barrier_init(void)
int i; int i;
int ret; int ret;
if (n_barrier_cbs == 0) if (n_barrier_cbs <= 0)
return 0; return 0;
if (cur_ops->call == NULL || cur_ops->cb_barrier == NULL) { if (cur_ops->call == NULL || cur_ops->cb_barrier == NULL) {
pr_alert("%s" TORTURE_FLAG pr_alert("%s" TORTURE_FLAG
...@@ -1788,12 +1799,15 @@ rcu_torture_init(void) ...@@ -1788,12 +1799,15 @@ rcu_torture_init(void)
writer_task); writer_task);
if (firsterr) if (firsterr)
goto unwind; goto unwind;
fakewriter_tasks = kzalloc(nfakewriters * sizeof(fakewriter_tasks[0]), if (nfakewriters > 0) {
GFP_KERNEL); fakewriter_tasks = kzalloc(nfakewriters *
if (fakewriter_tasks == NULL) { sizeof(fakewriter_tasks[0]),
VERBOSE_TOROUT_ERRSTRING("out of memory"); GFP_KERNEL);
firsterr = -ENOMEM; if (fakewriter_tasks == NULL) {
goto unwind; VERBOSE_TOROUT_ERRSTRING("out of memory");
firsterr = -ENOMEM;
goto unwind;
}
} }
for (i = 0; i < nfakewriters; i++) { for (i = 0; i < nfakewriters; i++) {
firsterr = torture_create_kthread(rcu_torture_fakewriter, firsterr = torture_create_kthread(rcu_torture_fakewriter,
...@@ -1820,7 +1834,7 @@ rcu_torture_init(void) ...@@ -1820,7 +1834,7 @@ rcu_torture_init(void)
if (firsterr) if (firsterr)
goto unwind; goto unwind;
} }
if (test_no_idle_hz) { if (test_no_idle_hz && shuffle_interval > 0) {
firsterr = torture_shuffle_init(shuffle_interval * HZ); firsterr = torture_shuffle_init(shuffle_interval * HZ);
if (firsterr) if (firsterr)
goto unwind; goto unwind;
......
...@@ -5,6 +5,6 @@ CONFIG_PREEMPT_NONE=n ...@@ -5,6 +5,6 @@ CONFIG_PREEMPT_NONE=n
CONFIG_PREEMPT_VOLUNTARY=n CONFIG_PREEMPT_VOLUNTARY=n
CONFIG_PREEMPT=y CONFIG_PREEMPT=y
CONFIG_DEBUG_LOCK_ALLOC=y CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=n CONFIG_PROVE_LOCKING=y
#CHECK#CONFIG_PROVE_RCU=n #CHECK#CONFIG_PROVE_RCU=y
CONFIG_RCU_EXPERT=y CONFIG_RCU_EXPERT=y
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment