diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-06-29 19:49:16 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-08-20 11:55:00 -0400 |
commit | a57eb940d130477a799dfb24a570ee04979c0f7f (patch) | |
tree | 5add1c135a302cf1c1a454b0620ed17eb802923b /init | |
parent | 4d87ffadbba88105f33271bef5f2c79366c6a4e1 (diff) |
rcu: Add a TINY_PREEMPT_RCU
Implement a small-memory-footprint uniprocessor-only implementation of
preemptible RCU. This implementation uses but a single blocked-tasks
list rather than the combinatorial number used per leaf rcu_node by
TREE_PREEMPT_RCU, which reduces memory consumption and greatly simplifies
processing. This version also takes advantage of uniprocessor execution
to accelerate grace periods in the case where there are no readers.
The general design is otherwise broadly similar to that of TREE_PREEMPT_RCU.
This implementation is a step towards having RCU implementation driven
off of the SMP and PREEMPT kernel configuration variables, which can
happen once this implementation has accumulated sufficient experience.
Removed ACCESS_ONCE() from __rcu_read_unlock() and added barrier() as
suggested by Steve Rostedt in order to avoid the compiler-reordering
issue noted by Mathieu Desnoyers (http://lkml.org/lkml/2010/8/16/183).
As can be seen below, CONFIG_TINY_PREEMPT_RCU represents almost 5Kbyte
savings compared to CONFIG_TREE_PREEMPT_RCU. Of course, for non-real-time
workloads, CONFIG_TINY_RCU is even better.
CONFIG_TREE_PREEMPT_RCU
text data bss dec filename
13 0 0 13 kernel/rcupdate.o
6170 825 28 7023 kernel/rcutree.o
----
7026 Total
CONFIG_TINY_PREEMPT_RCU
text data bss dec filename
13 0 0 13 kernel/rcupdate.o
2081 81 8 2170 kernel/rcutiny.o
----
2183 Total
CONFIG_TINY_RCU (non-preemptible)
text data bss dec filename
13 0 0 13 kernel/rcupdate.o
719 25 0 744 kernel/rcutiny.o
---
757 Total
Requested-by: Loïc Minier <loic.minier@canonical.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'init')
-rw-r--r-- | init/Kconfig | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig index dbc08baad77e..a619a1ac7f4c 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -348,7 +348,7 @@ config TREE_RCU | |||
348 | smaller systems. | 348 | smaller systems. |
349 | 349 | ||
350 | config TREE_PREEMPT_RCU | 350 | config TREE_PREEMPT_RCU |
351 | bool "Preemptable tree-based hierarchical RCU" | 351 | bool "Preemptible tree-based hierarchical RCU" |
352 | depends on PREEMPT | 352 | depends on PREEMPT |
353 | help | 353 | help |
354 | This option selects the RCU implementation that is | 354 | This option selects the RCU implementation that is |
@@ -366,8 +366,22 @@ config TINY_RCU | |||
366 | is not required. This option greatly reduces the | 366 | is not required. This option greatly reduces the |
367 | memory footprint of RCU. | 367 | memory footprint of RCU. |
368 | 368 | ||
369 | config TINY_PREEMPT_RCU | ||
370 | bool "Preemptible UP-only small-memory-footprint RCU" | ||
371 | depends on !SMP && PREEMPT | ||
372 | help | ||
373 | This option selects the RCU implementation that is designed | ||
374 | for real-time UP systems. This option greatly reduces the | ||
375 | memory footprint of RCU. | ||
376 | |||
369 | endchoice | 377 | endchoice |
370 | 378 | ||
379 | config PREEMPT_RCU | ||
380 | def_bool ( TREE_PREEMPT_RCU || TINY_PREEMPT_RCU ) | ||
381 | help | ||
382 | This option enables preemptible-RCU code that is common between | ||
383 | the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations. | ||
384 | |||
371 | config RCU_TRACE | 385 | config RCU_TRACE |
372 | bool "Enable tracing for RCU" | 386 | bool "Enable tracing for RCU" |
373 | depends on TREE_RCU || TREE_PREEMPT_RCU | 387 | depends on TREE_RCU || TREE_PREEMPT_RCU |