Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] cpuset memory spread slab cache hooks

Change the kmem_cache_create calls for certain slab caches to support cpuset
memory spreading.

See the previous patches, cpuset_mem_spread, for an explanation of cpuset
memory spreading, and cpuset_mem_spread_slab_cache for the slab cache support
for memory spreading.

The slab caches marked for now are: dentry_cache, inode_cache, some xfs slab
caches, and buffer_head. This list may change over time. In particular,
other file system types that are used extensively on large NUMA systems may
want to allow for spreading their directory and inode slab cache entries.

Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Paul Jackson and committed by
Linus Torvalds
b0196009 c61afb18

+15 -6
+5 -2
fs/buffer.c
··· 3143 3143 int nrpages; 3144 3144 3145 3145 bh_cachep = kmem_cache_create("buffer_head", 3146 - sizeof(struct buffer_head), 0, 3147 - SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_buffer_head, NULL); 3146 + sizeof(struct buffer_head), 0, 3147 + (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| 3148 + SLAB_MEM_SPREAD), 3149 + init_buffer_head, 3150 + NULL); 3148 3151 3149 3152 /* 3150 3153 * Limit the bh occupancy to 10% of ZONE_NORMAL
+2 -1
fs/dcache.c
··· 1682 1682 dentry_cache = kmem_cache_create("dentry_cache", 1683 1683 sizeof(struct dentry), 1684 1684 0, 1685 - SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, 1685 + (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| 1686 + SLAB_MEM_SPREAD), 1686 1687 NULL, NULL); 1687 1688 1688 1689 set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory);
+7 -2
fs/inode.c
··· 1375 1375 int loop; 1376 1376 1377 1377 /* inode slab cache */ 1378 - inode_cachep = kmem_cache_create("inode_cache", sizeof(struct inode), 1379 - 0, SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_once, NULL); 1378 + inode_cachep = kmem_cache_create("inode_cache", 1379 + sizeof(struct inode), 1380 + 0, 1381 + (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| 1382 + SLAB_MEM_SPREAD), 1383 + init_once, 1384 + NULL); 1380 1385 set_shrinker(DEFAULT_SEEKS, shrink_icache_memory); 1381 1386 1382 1387 /* Hash may have been set up in inode_init_early */
+1 -1
fs/xfs/linux-2.6/kmem.h
··· 100 100 101 101 #define KM_ZONE_HWALIGN SLAB_HWCACHE_ALIGN 102 102 #define KM_ZONE_RECLAIM SLAB_RECLAIM_ACCOUNT 103 - #define KM_ZONE_SPREAD 0 103 + #define KM_ZONE_SPREAD SLAB_MEM_SPREAD 104 104 105 105 #define kmem_zone kmem_cache 106 106 #define kmem_zone_t struct kmem_cache