Skip to content

Commit

Permalink
[PATCH] avoid -ENOMEM due reclaimable slab caches
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrea Arcangeli authored and Linus Torvalds committed May 5, 2005
1 parent f48d966 commit e422fd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit e422fd2

Please sign in to comment.