Commit 8cc3d21c authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[PATCH] tune vmalloc size

There are a few devices that use lots of ioremap space.  vmalloc space is a
showstopper problem for them.

this patch adds the vmalloc=<size> boot parameter to override
__VMALLOC_RESERVE.  The default is 128mb right now - e.g.  vmalloc=256m
doubles the size.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarArjan van de Ven <arjanv@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6ebae79a
......@@ -453,6 +453,11 @@ running once the system is up.
hd?= [HW] (E)IDE subsystem
hd?lun= See Documentation/ide.txt.
highmem=nn[KMG] [KNL,BOOT] forces the highmem zone to have an exact
size of <nn>. This works even on boxes that have no
highmem otherwise. This also works to reduce highmem
size on bigger boxes.
hisax= [HW,ISDN]
See Documentation/isdn/README.HiSax.
......@@ -1293,6 +1298,12 @@ running once the system is up.
This is actually a boot loader parameter; the value is
passed to the kernel using a special protocol.
vmalloc=nn[KMG] [KNL,BOOT] forces the vmalloc area to have an exact
size of <nn>. This can be used to increase the
minimum size (128MB on x86). It can also be used to
decrease the size and leave more room for directly
mapped kernel RAM.
vmhalt= [KNL,S390]
vmpoff= [KNL,S390]
......
......@@ -156,7 +156,7 @@ cmd_line_ptr: .long 0 # (Header version 0x0202 or later)
# can be located anywhere in
# low memory 0x10000 or higher.
ramdisk_max: .long (MAXMEM-1) & 0x7fffffff
ramdisk_max: .long (-__PAGE_OFFSET-(512 << 20)-1) & 0x7fffffff
# (Header version 0x0203 or later)
# The highest safe address for
# the contents of an initrd
......
......@@ -815,6 +815,14 @@ static void __init parse_cmdline_early (char ** cmdline_p)
if (c == ' ' && !memcmp(from, "highmem=", 8))
highmem_pages = memparse(from+8, &from) >> PAGE_SHIFT;
/*
* vmalloc=size forces the vmalloc area to be exactly 'size'
* bytes. This can be used to increase (or decrease) the
* vmalloc area - the default is 128m.
*/
if (c == ' ' && !memcmp(from, "vmalloc=", 8))
__VMALLOC_RESERVE = memparse(from+8, &from);
c = *(from++);
if (!c)
break;
......
......@@ -40,6 +40,8 @@
#include <asm/tlbflush.h>
#include <asm/sections.h>
unsigned int __VMALLOC_RESERVE = 128 << 20;
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
unsigned long highstart_pfn, highend_pfn;
......
......@@ -94,13 +94,13 @@ typedef struct { unsigned long pgprot; } pgprot_t;
* and CONFIG_HIGHMEM64G options in the kernel configuration.
*/
#ifndef __ASSEMBLY__
/*
* This much address space is reserved for vmalloc() and iomap()
* as well as fixmap mappings.
*/
#define __VMALLOC_RESERVE (128 << 20)
#ifndef __ASSEMBLY__
extern unsigned int __VMALLOC_RESERVE;
/* Pure 2^n version of get_order */
static __inline__ int get_order(unsigned long size)
......
......@@ -247,6 +247,8 @@ struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
out:
write_unlock(&vmlist_lock);
kfree(area);
if (printk_ratelimit())
printk(KERN_WARNING "allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.\n");
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment