public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] tune vmalloc size
@ 2004-09-15 12:53 Ingo Molnar
  2004-09-15 12:31 ` Alan Cox
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Ingo Molnar @ 2004-09-15 12:53 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Arjan van de Ven, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 264 bytes --]


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.

	Ingo

[-- Attachment #2: tune-vmalloc.patch --]
[-- Type: text/plain, Size: 2462 bytes --]


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: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjanv@redhat.com>

--- linux/arch/i386/kernel/setup.c.orig	
+++ linux/arch/i386/kernel/setup.c	
@@ -814,7 +814,15 @@ static void __init parse_cmdline_early (
 		 */
 		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;
--- linux/arch/i386/mm/init.c.orig	
+++ linux/arch/i386/mm/init.c	
@@ -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;
 
--- linux/arch/i386/boot/setup.S.orig	
+++ linux/arch/i386/boot/setup.S	
@@ -156,7 +156,7 @@ cmd_line_ptr:	.long 0			# (Header versio
 					# 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
--- linux/include/asm-i386/page.h.orig	
+++ linux/include/asm-i386/page.h	
@@ -94,13 +94,13 @@ typedef struct { unsigned long pgprot; }
  * 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)
--- linux/mm/vmalloc.c.orig	
+++ linux/mm/vmalloc.c	
@@ -247,6 +247,8 @@ found:
 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;
 }
 

^ permalink raw reply	[flat|nested] 16+ messages in thread
[parent not found: <2EHyq-5or-39@gated-at.bofh.it>]

end of thread, other threads:[~2004-09-17 22:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-15 12:53 [patch] tune vmalloc size Ingo Molnar
2004-09-15 12:31 ` Alan Cox
2004-09-15 13:29 ` Joe Korty
2004-09-15 13:31   ` Arjan van de Ven
2004-09-15 13:40     ` Joe Korty
2004-09-15 14:14       ` Dave Jones
2004-09-15 13:40   ` Dave Jones
2004-09-15 21:33 ` Andrew Morton
2004-09-15 21:45   ` Ingo Molnar
     [not found] <2EHyq-5or-39@gated-at.bofh.it>
2004-09-15 13:29 ` Andi Kleen
2004-09-15 14:05   ` Rodrigo FGV
2004-09-15 14:12   ` Arjan van de Ven
2004-09-17 22:03     ` Chris Wedgwood
2004-09-17 22:06       ` Arjan van de Ven
2004-09-15 14:58   ` Karsten Keil
2004-09-15 15:07   ` Martin J. Bligh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox