linux/kernel/rcu
Chen Gang d100895086 rcu/torture: Dynamically allocate SRCU output buffer to avoid overflow
If the rcutorture SRCU output exceeds 4096 bytes, for example, if you
have more than about 75 CPUs, it will overflow the current statically
allocated buffer.  This commit therefore replaces this static buffer
with a dynamically buffer whose size is based on the number of CPUs.

Benefits:

 - Avoids both buffer overflow and output truncation.
 - Handles an arbitrarily large number of CPUs.
 - Straightforward implementation.

Shortcomings:

 - Some memory is wasted:

   1 cpu now comsumes 50 - 60 bytes, and this patch provides 200 bytes.
   Therefore, for 1K CPUs, roughly 100KB of memory will be wasted.
   However, the memory is freed immediately after printing, so this
   wastage should not be a problem in practice.

Testing (Fedora16 2 CPUs, 2GB RAM x86_64):

 - as module, with/without "torture_type=srcu".
 - build-in not boot runnable, with/without "torture_type=srcu".
 - build-in let boot runnable, with/without "torture_type=srcu".

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2013-12-12 12:34:16 -08:00
..
Makefile
rcu.h rcu: Provide better diagnostics for blocking in RCU callback functions 2013-12-09 15:12:39 -08:00
srcu.c rcu: Improve SRCU's grace-period comments 2013-12-09 15:12:38 -08:00
tiny_plugin.h
tiny.c This batch of changes is mostly clean ups and small bug fixes. 2013-11-16 12:23:18 -08:00
torture.c rcu/torture: Dynamically allocate SRCU output buffer to avoid overflow 2013-12-12 12:34:16 -08:00
tree_plugin.h rcu: Don't activate RCU core on NO_HZ_FULL CPUs 2013-12-12 12:34:15 -08:00
tree_trace.c rcu: Break call_rcu() deadlock involving scheduler and perf 2013-12-03 10:10:18 -08:00
tree.c rcu: Don't activate RCU core on NO_HZ_FULL CPUs 2013-12-12 12:34:15 -08:00
tree.h rcu: Don't activate RCU core on NO_HZ_FULL CPUs 2013-12-12 12:34:15 -08:00
update.c rcu: Provide better diagnostics for blocking in RCU callback functions 2013-12-09 15:12:39 -08:00