Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0d08e0d3a97cce22ebf80b54785e00d9b94e1add
Commit:     0d08e0d3a97cce22ebf80b54785e00d9b94e1add
Parent:     bbf30a1650be396b5467f769f4fbee715f16ec36
Author:     Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 19:27:12 2007 +0200
Committer:  Andi Kleen <[EMAIL PROTECTED]>
CommitDate: Wed May 2 19:27:12 2007 +0200

    [PATCH] x86-64: Fix vmalloc_32 to really allocate <4GB on 64bit platforms
    
    Ugly ifdef, but should handle all 64bit platforms that have suitable
    zones. On some like Altix it's probably impossible without IOMMU
    use to get memory <4GB this way,  but they have to live with that.
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
---
 mm/vmalloc.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 9eef486..cb5aabd 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -431,7 +431,7 @@ void *__vmalloc_area_node(struct vm_struct *area, gfp_t 
gfp_mask,
                area->flags |= VM_VPAGES;
        } else {
                pages = kmalloc_node(array_size,
-                               (gfp_mask & ~(__GFP_HIGHMEM | __GFP_ZERO)),
+                               (gfp_mask & GFP_LEVEL_MASK),
                                node);
        }
        area->pages = pages;
@@ -577,6 +577,14 @@ void *vmalloc_exec(unsigned long size)
        return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC);
 }
 
+#if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32)
+#define GFP_VMALLOC32 GFP_DMA32
+#elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA)
+#define GFP_VMALLOC32 GFP_DMA
+#else
+#define GFP_VMALLOC32 GFP_KERNEL
+#endif
+
 /**
  *     vmalloc_32  -  allocate virtually contiguous memory (32bit addressable)
  *     @size:          allocation size
@@ -586,7 +594,7 @@ void *vmalloc_exec(unsigned long size)
  */
 void *vmalloc_32(unsigned long size)
 {
-       return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
+       return __vmalloc(size, GFP_VMALLOC32, PAGE_KERNEL);
 }
 EXPORT_SYMBOL(vmalloc_32);
 
@@ -602,7 +610,7 @@ void *vmalloc_32_user(unsigned long size)
        struct vm_struct *area;
        void *ret;
 
-       ret = __vmalloc(size, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
+       ret = __vmalloc(size, GFP_VMALLOC32 | __GFP_ZERO, PAGE_KERNEL);
        if (ret) {
                write_lock(&vmlist_lock);
                area = __find_vm_area(ret);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to