diff options
author | Paul Jackson <pj@sgi.com> | 2006-03-24 06:16:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 10:33:23 -0500 |
commit | b0196009d8c3ecf6ea6ec080c63d2ccc146e7ad9 (patch) | |
tree | 3fcb06af54faf92fa5d9d82d5659762d2b742e1c | |
parent | c61afb181c649754ea221f104e268cbacfc993e3 (diff) |
[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>
-rw-r--r-- | fs/buffer.c | 7 | ||||
-rw-r--r-- | fs/dcache.c | 3 | ||||
-rw-r--r-- | fs/inode.c | 9 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/kmem.h | 2 |
4 files changed, 15 insertions, 6 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 0d6ca7bac6c8..36c7253bea72 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -3143,8 +3143,11 @@ void __init buffer_init(void) | |||
3143 | int nrpages; | 3143 | int nrpages; |
3144 | 3144 | ||
3145 | bh_cachep = kmem_cache_create("buffer_head", | 3145 | bh_cachep = kmem_cache_create("buffer_head", |
3146 | sizeof(struct buffer_head), 0, | 3146 | sizeof(struct buffer_head), 0, |
3147 | SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_buffer_head, NULL); | 3147 | (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| |
3148 | SLAB_MEM_SPREAD), | ||
3149 | init_buffer_head, | ||
3150 | NULL); | ||
3148 | 3151 | ||
3149 | /* | 3152 | /* |
3150 | * Limit the bh occupancy to 10% of ZONE_NORMAL | 3153 | * Limit the bh occupancy to 10% of ZONE_NORMAL |
diff --git a/fs/dcache.c b/fs/dcache.c index 11dc83092d4a..653f64ce98e2 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -1682,7 +1682,8 @@ static void __init dcache_init(unsigned long mempages) | |||
1682 | dentry_cache = kmem_cache_create("dentry_cache", | 1682 | dentry_cache = kmem_cache_create("dentry_cache", |
1683 | sizeof(struct dentry), | 1683 | sizeof(struct dentry), |
1684 | 0, | 1684 | 0, |
1685 | SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, | 1685 | (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| |
1686 | SLAB_MEM_SPREAD), | ||
1686 | NULL, NULL); | 1687 | NULL, NULL); |
1687 | 1688 | ||
1688 | set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory); | 1689 | set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory); |
diff --git a/fs/inode.c b/fs/inode.c index 25967b67903d..a51c671c54cf 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1375,8 +1375,13 @@ void __init inode_init(unsigned long mempages) | |||
1375 | int loop; | 1375 | int loop; |
1376 | 1376 | ||
1377 | /* inode slab cache */ | 1377 | /* inode slab cache */ |
1378 | inode_cachep = kmem_cache_create("inode_cache", sizeof(struct inode), | 1378 | inode_cachep = kmem_cache_create("inode_cache", |
1379 | 0, SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_once, NULL); | 1379 | sizeof(struct inode), |
1380 | 0, | ||
1381 | (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| | ||
1382 | SLAB_MEM_SPREAD), | ||
1383 | init_once, | ||
1384 | NULL); | ||
1380 | set_shrinker(DEFAULT_SEEKS, shrink_icache_memory); | 1385 | set_shrinker(DEFAULT_SEEKS, shrink_icache_memory); |
1381 | 1386 | ||
1382 | /* Hash may have been set up in inode_init_early */ | 1387 | /* Hash may have been set up in inode_init_early */ |
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h index f0268a84e6fd..2cfd33d4d8aa 100644 --- a/fs/xfs/linux-2.6/kmem.h +++ b/fs/xfs/linux-2.6/kmem.h | |||
@@ -100,7 +100,7 @@ extern void kmem_free(void *, size_t); | |||
100 | 100 | ||
101 | #define KM_ZONE_HWALIGN SLAB_HWCACHE_ALIGN | 101 | #define KM_ZONE_HWALIGN SLAB_HWCACHE_ALIGN |
102 | #define KM_ZONE_RECLAIM SLAB_RECLAIM_ACCOUNT | 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 | #define kmem_zone kmem_cache | 105 | #define kmem_zone kmem_cache |
106 | #define kmem_zone_t struct kmem_cache | 106 | #define kmem_zone_t struct kmem_cache |