summaryrefslogtreecommitdiff
path: root/include/linux/rculist.h
diff options
context:
space:
mode:
authorChen Gang <gang.chen@asianux.com>2013-11-07 06:30:25 +0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-12-13 00:34:16 +0400
commitd10089508613f42b8b54cf33456a821c7cf3d442 (patch)
tree91e696e6a989ff8a21af20481ac99db40bc2e27f /include/linux/rculist.h
parenta096932f0c9c9dca9cce72f1c0fb2395df8f2dff (diff)
downloadlinux-d10089508613f42b8b54cf33456a821c7cf3d442.tar.xz
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>
Diffstat (limited to 'include/linux/rculist.h')
0 files changed, 0 insertions, 0 deletions