Commit 148b113a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] shrink the amount of vmalloc space reserved for kmap

Patch from Manfred Spraul <manfred@colorfullife.com>

Effectively adds another 24 megabytes of ia32 KVA.

kmap uses a 4 MB (2 MB if PAE is enabled) area for the persistant mappings.
But PKMAP_BASE is 4GB-32MB, i.e.  around 28 MB are reserved for kmap (4 MB
for fixmappings).

The attached patch shrink that to 4 MB (+4MB for fixmappings) and adds a test
to check for an overlap between fixmap and kmap areas.
parent d06f1e21
...@@ -438,6 +438,16 @@ void __init mem_init(void) ...@@ -438,6 +438,16 @@ void __init mem_init(void)
bad_ppro = ppro_with_ram_bug(); bad_ppro = ppro_with_ram_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(); set_max_mapnr_init();
#ifdef CONFIG_HIGHMEM #ifdef CONFIG_HIGHMEM
......
...@@ -39,7 +39,7 @@ extern void kmap_init(void); ...@@ -39,7 +39,7 @@ extern void kmap_init(void);
* easily, subsequent pte tables have to be allocated in one physical * easily, subsequent pte tables have to be allocated in one physical
* chunk of RAM. * chunk of RAM.
*/ */
#define PKMAP_BASE (0xfe000000UL) #define PKMAP_BASE (0xff800000UL)
#ifdef CONFIG_X86_PAE #ifdef CONFIG_X86_PAE
#define LAST_PKMAP 512 #define LAST_PKMAP 512
#else #else
......
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