public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: Arjan van de Ven <arjanv@redhat.com>, linux-kernel@vger.kernel.org
Subject: [patch] tune vmalloc size
Date: Wed, 15 Sep 2004 14:53:56 +0200	[thread overview]
Message-ID: <20040915125356.GA11250@elte.hu> (raw)

[-- 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;
 }
 

             reply	other threads:[~2004-09-15 12:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-15 12:53 Ingo Molnar [this message]
2004-09-15 12:31 ` [patch] tune vmalloc size 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040915125356.GA11250@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=arjanv@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox