[PATCH 5/5] cpuset memory spread slab cache hooks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Paul Jackson <[email protected]>

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 slag caches marked for now are: dentry_cache, inode_cache,
and buffer_head.  This list may change over time.

Signed-off-by: Paul Jackson

---

 fs/buffer.c |    7 +++++--
 fs/dcache.c |    3 ++-
 fs/inode.c  |    9 +++++++--
 3 files changed, 14 insertions(+), 5 deletions(-)

--- 2.6.16-rc1-mm5.orig/fs/dcache.c	2006-02-03 20:14:45.616310776 -0800
+++ 2.6.16-rc1-mm5/fs/dcache.c	2006-02-03 21:56:36.605864543 -0800
@@ -1683,7 +1683,8 @@ static void __init dcache_init(unsigned 
 	dentry_cache = kmem_cache_create("dentry_cache",
 					 sizeof(struct dentry),
 					 0,
-					 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC,
+					 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
+					 SLAB_MEM_SPREAD),
 					 NULL, NULL);
 	
 	shrinker = set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory);
--- 2.6.16-rc1-mm5.orig/fs/inode.c	2006-02-03 20:14:45.619240496 -0800
+++ 2.6.16-rc1-mm5/fs/inode.c	2006-02-03 21:56:36.606841116 -0800
@@ -1376,8 +1376,13 @@ void __init inode_init(unsigned long mem
 	struct shrinker *shrinker;
 
 	/* inode slab cache */
-	inode_cachep = kmem_cache_create("inode_cache", sizeof(struct inode),
-				0, SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_once, NULL);
+	inode_cachep = kmem_cache_create("inode_cache",
+					 sizeof(struct inode),
+					 0,
+					 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
+					 SLAB_MEM_SPREAD),
+					 init_once,
+					 NULL);
 	shrinker = set_shrinker(DEFAULT_SEEKS, shrink_icache_memory);
 	kmem_set_shrinker(inode_cachep, shrinker);
 
--- 2.6.16-rc1-mm5.orig/fs/buffer.c	2006-02-03 20:14:32.642534053 -0800
+++ 2.6.16-rc1-mm5/fs/buffer.c	2006-02-03 21:56:36.608794263 -0800
@@ -3203,8 +3203,11 @@ void __init buffer_init(void)
 	int nrpages;
 
 	bh_cachep = kmem_cache_create("buffer_head",
-			sizeof(struct buffer_head), 0,
-			SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_buffer_head, NULL);
+					sizeof(struct buffer_head), 0,
+					(SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
+					SLAB_MEM_SPREAD),
+					init_buffer_head,
+					NULL);
 
 	/*
 	 * Limit the bh occupancy to 10% of ZONE_NORMAL

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux