All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH, BACKPORT] shrink address space reserved for kmap
Date: Wed, 14 Jan 2004 20:01:03 +0100	[thread overview]
Message-ID: <400591EF.6090808@colorfullife.com> (raw)

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

If highmem is enabled, 32 MB at the top of the address space is reserved 
for kmap. This is not necessary: the kmap area is at most 4 MB long, 
reserving 8 MB is sufficient (the last few kB are needed for the 
fixmaps, and the kmap area must be 4 MB-aligned). Recovering these 24 MB 
is important - it's increases the size of the vmalloc pool.
2.6 contains a similar patch.
The patch also adds a safety check to detect a collision between fixmap 
and kmap mappings - just in case someone uses huge fixmaps.

Marcelo, could you add it to your tree?

--
    Manfred

[-- Attachment #2: patch-kmap-24 --]
[-- Type: text/plain, Size: 1118 bytes --]

// $Header$
// Kernel Version:
//  VERSION = 2
//  PATCHLEVEL = 4
//  SUBLEVEL = 21
//  EXTRAVERSION = -pre2
--- 2.4/include/asm-i386/highmem.h	2002-08-03 02:39:45.000000000 +0200
+++ build-2.4/include/asm-i386/highmem.h	2003-01-06 00:39:15.000000000 +0100
@@ -46,7 +46,7 @@
  * easily, subsequent pte tables have to be allocated in one physical
  * chunk of RAM.
  */
-#define PKMAP_BASE (0xfe000000UL)
+#define PKMAP_BASE (0xff800000UL)
 #ifdef CONFIG_X86_PAE
 #define LAST_PKMAP 512
 #else
--- 2.4/arch/i386/mm/init.c	2003-01-05 21:19:06.000000000 +0100
+++ build-2.4/arch/i386/mm/init.c	2003-01-06 00:40:23.000000000 +0100
@@ -510,7 +510,15 @@
 
 	if (!mem_map)
 		BUG();
-	
+#ifdef CONFIG_HIGHMEM
+	/* check that fixmap and pkmap do not overlap */
+	if (PKMAP_BASE+LAST_PKMAP*PAGE_SIZE >= FIXADDR_START) {
+		printk(KERN_ERR "fixmap and kmap areas overlap - this will crash\n");
+		printk(KERN_ERR "pkstart: %lxh pkend: %lxh fixstart %lxh\n",
+				PKMAP_BASE, PKMAP_BASE+LAST_PKMAP*PAGE_SIZE, FIXADDR_START);
+		BUG();
+	}
+#endif
 	set_max_mapnr_init();
 
 	high_memory = (void *) __va(max_low_pfn * PAGE_SIZE);

                 reply	other threads:[~2004-01-14 19:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=400591EF.6090808@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.