]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/ldt.c
smp_call_function: get rid of the unused nonatomic/retry argument
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / ldt.c
index b8ef46270e246d1d77a39777bb27292fc30a1d66..cb0a6398c64baa5678160d1e818ce9951b13d77c 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/mm.h>
 #include <linux/smp.h>
 #include <linux/vmalloc.h>
-#include <linux/slab.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -36,11 +35,12 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
        if (mincount <= pc->size)
                return 0;
        oldsize = pc->size;
-       mincount = (mincount + 511) & (~511);
+       mincount = (mincount + (PAGE_SIZE / LDT_ENTRY_SIZE - 1)) &
+                       (~(PAGE_SIZE / LDT_ENTRY_SIZE - 1));
        if (mincount * LDT_ENTRY_SIZE > PAGE_SIZE)
                newldt = vmalloc(mincount * LDT_ENTRY_SIZE);
        else
-               newldt = kmalloc(mincount * LDT_ENTRY_SIZE, GFP_KERNEL);
+               newldt = (void *)__get_free_page(GFP_KERNEL);
 
        if (!newldt)
                return -ENOMEM;
@@ -68,7 +68,7 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
                load_LDT(pc);
                mask = cpumask_of_cpu(smp_processor_id());
                if (!cpus_equal(current->mm->cpu_vm_mask, mask))
-                       smp_call_function(flush_ldt, NULL, 1, 1);
+                       smp_call_function(flush_ldt, NULL, 1);
                preempt_enable();
 #else
                load_LDT(pc);
@@ -78,7 +78,7 @@ static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
                if (oldsize * LDT_ENTRY_SIZE > PAGE_SIZE)
                        vfree(oldldt);
                else
-                       kfree(oldldt);
+                       put_page(virt_to_page(oldldt));
        }
        return 0;
 }
@@ -129,7 +129,7 @@ void destroy_context(struct mm_struct *mm)
                if (mm->context.size * LDT_ENTRY_SIZE > PAGE_SIZE)
                        vfree(mm->context.ldt);
                else
-                       kfree(mm->context.ldt);
+                       put_page(virt_to_page(mm->context.ldt));
                mm->context.size = 0;
        }
 }