[PATCH] avoid -ENOMEM due reclaimable slab caches
authorAndrea Arcangeli <andrea@suse.de>
Thu, 5 May 2005 23:15:04 +0000 (16:15 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 5 May 2005 23:36:30 +0000 (16:36 -0700)
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/buffer.c
fs/inode.c

index 5f525b3c6d9f04d520d117295f3d880d29e7e9ec..6ed59497fd4d0aa53f1b0679420f93662b95e6f1 100644 (file)
@@ -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
index af8fd78d2099a0852d7867a4b2691924c1ed3982..90a110feb713fefa96594a9668ec5345b5e67c9e 100644 (file)
@@ -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 */