Skip to contentSkip to conversation

rcu: don't allocate bootmem from rcu_init

PATCH In review Sasha Levin 2 participants 2 messages Mar 26, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: don't allocate bootmem from rcu_init

When rcu_init is called we already have slab working, allocating bootmem at that point results in warnings and an allocation from slab.

---
 kernel/rcutree_plugin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcutree_plugin.h +1 -1
index d084ae3..73bac82 100644
@@ -87,7 +87,7 @@ static void __init rcu_bootup_announce_oddness(void)
 #ifdef CONFIG_RCU_NOCB_CPU
 #ifndef CONFIG_RCU_NOCB_CPU_NONE
 	if (!have_rcu_nocb_mask) {
-		alloc_bootmem_cpumask_var(&rcu_nocb_mask);
+		alloc_cpumask_var(&rcu_nocb_mask, GFP_KERNEL);
 		have_rcu_nocb_mask = true;
 	}
 #ifdef CONFIG_RCU_NOCB_CPU_ZERO
Signature · 1 line
1.8.1.5
#1 lore raw
Quoted 2 lines · Sasha Levin

When rcu_init is called we already have slab working, allocating bootmem at that point results in warnings and an allocation from slab.

Good catch, queued for 3.11, thank you!

Thanx, Paul

Quoted 21 lines
---
 kernel/rcutree_plugin.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcutree_plugin.h +1 -1
index d084ae3..73bac82 100644
@@ -87,7 +87,7 @@ static void __init rcu_bootup_announce_oddness(void)
 #ifdef CONFIG_RCU_NOCB_CPU
 #ifndef CONFIG_RCU_NOCB_CPU_NONE
 	if (!have_rcu_nocb_mask) {
-		alloc_bootmem_cpumask_var(&rcu_nocb_mask);
+		alloc_cpumask_var(&rcu_nocb_mask, GFP_KERNEL);
 		have_rcu_nocb_mask = true;
 	}
 #ifdef CONFIG_RCU_NOCB_CPU_ZERO
Signature · 1 line
1.8.1.5