x86: remove some alloc_bootmem_cpumask_var calling
authorYinghai Lu <yinghai@kernel.org>
Mon, 25 May 2009 12:10:58 +0000 (15:10 +0300)
committerPekka Enberg <penberg@cs.helsinki.fi>
Thu, 11 Jun 2009 16:27:07 +0000 (19:27 +0300)
Now that we set up the slab allocator earlier, we can get rid of some
alloc_bootmem_cpumask_var() calls in boot code.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
arch/x86/kernel/apic/io_apic.c
include/linux/irq.h
kernel/cpuset.c
kernel/profile.c
lib/cpumask.c

index 1946fac42ab3cb8a406d46509a983163cd347008..139201a562bad98c14dc6d20c1d9feb9918360e2 100644 (file)
@@ -185,8 +185,8 @@ int __init arch_early_irq_init(void)
        for (i = 0; i < count; i++) {
                desc = irq_to_desc(i);
                desc->chip_data = &cfg[i];
-               alloc_bootmem_cpumask_var(&cfg[i].domain);
-               alloc_bootmem_cpumask_var(&cfg[i].old_domain);
+               alloc_cpumask_var(&cfg[i].domain, GFP_NOWAIT);
+               alloc_cpumask_var(&cfg[i].old_domain, GFP_NOWAIT);
                if (i < NR_IRQS_LEGACY)
                        cpumask_setall(cfg[i].domain);
        }
index eedbb8e5e0ccff99c79594b6485fd9259049d088..1e50c34f0062854ef167130ad349f1385adcb4d2 100644 (file)
@@ -430,23 +430,19 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
  * Returns true if successful (or not required).
  */
 static inline bool alloc_desc_masks(struct irq_desc *desc, int node,
-                                                               bool boot)
+                                                       bool boot)
 {
-#ifdef CONFIG_CPUMASK_OFFSTACK
-       if (boot) {
-               alloc_bootmem_cpumask_var(&desc->affinity);
+       gfp_t gfp = GFP_ATOMIC;
 
-#ifdef CONFIG_GENERIC_PENDING_IRQ
-               alloc_bootmem_cpumask_var(&desc->pending_mask);
-#endif
-               return true;
-       }
+       if (boot)
+               gfp = GFP_NOWAIT;
 
-       if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node))
+#ifdef CONFIG_CPUMASK_OFFSTACK
+       if (!alloc_cpumask_var_node(&desc->affinity, gfp, node))
                return false;
 
 #ifdef CONFIG_GENERIC_PENDING_IRQ
-       if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) {
+       if (!alloc_cpumask_var_node(&desc->pending_mask, gfp, node)) {
                free_cpumask_var(desc->affinity);
                return false;
        }
index 026faccca869e396d378693422e29e9c82f739ac..d5a7e17474ee354259e71878156b6ea82ac8a6a2 100644 (file)
@@ -1857,7 +1857,7 @@ struct cgroup_subsys cpuset_subsys = {
 
 int __init cpuset_init_early(void)
 {
-       alloc_bootmem_cpumask_var(&top_cpuset.cpus_allowed);
+       alloc_cpumask_var(&top_cpuset.cpus_allowed, GFP_NOWAIT);
 
        top_cpuset.mems_generation = cpuset_mems_generation++;
        return 0;
index 7724e0409bae7222638fae02c1fe0924e4ae751a..28cf26ad2d247e497411f4603496209b1f8493f0 100644 (file)
@@ -111,12 +111,6 @@ int __ref profile_init(void)
        /* only text is profiled */
        prof_len = (_etext - _stext) >> prof_shift;
        buffer_bytes = prof_len*sizeof(atomic_t);
-       if (!slab_is_available()) {
-               prof_buffer = alloc_bootmem(buffer_bytes);
-               alloc_bootmem_cpumask_var(&prof_cpu_mask);
-               cpumask_copy(prof_cpu_mask, cpu_possible_mask);
-               return 0;
-       }
 
        if (!alloc_cpumask_var(&prof_cpu_mask, GFP_KERNEL))
                return -ENOMEM;
index eb23aaa0c7b8138781335105bf2fe1841d4f0649..7bb4142a502f3a8ceb57fb9e24d24d8bfe81332d 100644 (file)
@@ -92,15 +92,8 @@ int cpumask_any_but(const struct cpumask *mask, unsigned int cpu)
  */
 bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node)
 {
-       if (likely(slab_is_available()))
-               *mask = kmalloc_node(cpumask_size(), flags, node);
-       else {
-#ifdef CONFIG_DEBUG_PER_CPU_MAPS
-               printk(KERN_ERR
-                       "=> alloc_cpumask_var: kmalloc not available!\n");
-#endif
-               *mask = NULL;
-       }
+       *mask = kmalloc_node(cpumask_size(), flags, node);
+
 #ifdef CONFIG_DEBUG_PER_CPU_MAPS
        if (!*mask) {
                printk(KERN_ERR "=> alloc_cpumask_var: failed!\n");