@@ -206,6 +206,9 @@ module_param(rcu_min_cached_objs, int, 0444);
static int rcu_delay_page_cache_fill_msec = 5000;
module_param(rcu_delay_page_cache_fill_msec, int, 0444);
+static bool use_dyn_rcu_head __read_mostly;
+module_param(use_dyn_rcu_head, bool, 0444);
+
/* Retrieve RCU kthreads priority for rcutorture */
int rcu_get_gp_kthreads_prio(void)
{
@@ -3814,6 +3817,9 @@ attach_rcu_head_to_object(void *obj)
{
struct dyn_rcu_head *rhp;
+ if (!use_dyn_rcu_head)
+ return NULL;
+
rhp = kmalloc(sizeof(struct dyn_rcu_head), GFP_KERNEL |
__GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN);
Add a sysfs attribute to control whether a dynamically rcu_head should be attached or not. It can be controlled via "/sys/module/rcutree/parameters/use_dyn_rcu_head". By default it is OFF. Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com> --- kernel/rcu/tree.c | 6 ++++++ 1 file changed, 6 insertions(+)