From: Andrea Arcangeli Date: Thu, 5 May 2005 23:15:04 +0000 (-0700) Subject: [PATCH] avoid -ENOMEM due reclaimable slab caches X-Git-Tag: v2.6.12-rc4~113 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e422fd2c965ad1b0e4eadaabd0adb77e8a93e74e;p=linux-2.6-omap-h63xx.git [PATCH] 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/buffer.c b/fs/buffer.c index 5f525b3c6d9..6ed59497fd4 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -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 diff --git a/fs/inode.c b/fs/inode.c index af8fd78d209..90a110feb71 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1336,7 +1336,7 @@ void __init inode_init(unsigned long mempages) /* 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 */