linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* fix for mmap failures with large memory
@ 2005-05-04  1:35 Andrea Arcangeli
  0 siblings, 0 replies; only message in thread
From: Andrea Arcangeli @ 2005-05-04  1:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm

Hello Andrew,

We've got bugreports of mmap failing with ENOMEM on large 64bit ram
systems despite lots of ram was still available.

Looking around I noticed icache and buffer headers were not account as
reclaimable, this lead the overcommit checks to fail on largemem
systems, after this the problem disappeared for now.

Patch is untested on 2.6.12 kernels, but porting was trivial of course.
Please apply, thanks a lot!

BTW, very nice the way 2.6 can differentiate the reclaimable slab
objects from the not-reclaimable ones, the brainer stuff of that logic
was all right ;).

From: Andrea Arcangeli <andrea@suse.de>
Subject: avoid -ENOMEM due reclaimable slab caches

This makes sure that reclaimable buffer headers and reclaimable inodes
are accounted properly during the overcommit checks.

Signed-off-by: Andrea Arcangeli <andrea@suse.de>

--- x/fs/inode.c.orig	2005-04-27 16:35:57.000000000 +0200
+++ x/fs/inode.c	2005-05-04 03:31:57.000000000 +0200
@@ -1336,7 +1336,7 @@ void __init inode_init(unsigned long mem
 
 	/* inode slab cache */
 	inode_cachep = kmem_cache_create("inode_cache", sizeof(struct inode),
-				0, SLAB_PANIC, init_once, NULL);
+				0, SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_once, NULL);
 	set_shrinker(DEFAULT_SEEKS, shrink_icache_memory);
 
 	/* Hash may have been set up in inode_init_early */
--- x/fs/buffer.c.orig	2005-04-27 16:35:56.000000000 +0200
+++ x/fs/buffer.c	2005-05-04 03:32:17.000000000 +0200
@@ -3115,7 +3115,7 @@ void __init buffer_init(void)
 
 	bh_cachep = kmem_cache_create("buffer_head",
 			sizeof(struct buffer_head), 0,
-			SLAB_PANIC, init_buffer_head, NULL);
+			SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_buffer_head, NULL);
 
 	/*
 	 * Limit the bh occupancy to 10% of ZONE_NORMAL
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-04  1:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-04  1:35 fix for mmap failures with large memory Andrea Arcangeli

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