Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0196009 authored by Paul Jackson's avatar Paul Jackson Committed by Linus Torvalds
Browse files

[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: default avatarPaul Jackson <pj@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c61afb18
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -3144,7 +3144,10 @@ void __init buffer_init(void)


	bh_cachep = kmem_cache_create("buffer_head",
	bh_cachep = kmem_cache_create("buffer_head",
					sizeof(struct buffer_head), 0,
					sizeof(struct buffer_head), 0,
			SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_buffer_head, NULL);
					(SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
					SLAB_MEM_SPREAD),
					init_buffer_head,
					NULL);


	/*
	/*
	 * Limit the bh occupancy to 10% of ZONE_NORMAL
	 * Limit the bh occupancy to 10% of ZONE_NORMAL
+2 −1
Original line number Original line Diff line number Diff line
@@ -1682,7 +1682,8 @@ static void __init dcache_init(unsigned long mempages)
	dentry_cache = kmem_cache_create("dentry_cache",
	dentry_cache = kmem_cache_create("dentry_cache",
					 sizeof(struct dentry),
					 sizeof(struct dentry),
					 0,
					 0,
					 SLAB_RECLAIM_ACCOUNT|SLAB_PANIC,
					 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
					 SLAB_MEM_SPREAD),
					 NULL, NULL);
					 NULL, NULL);
	
	
	set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory);
	set_shrinker(DEFAULT_SEEKS, shrink_dcache_memory);
+7 −2
Original line number Original line Diff line number Diff line
@@ -1375,8 +1375,13 @@ void __init inode_init(unsigned long mempages)
	int loop;
	int loop;


	/* inode slab cache */
	/* inode slab cache */
	inode_cachep = kmem_cache_create("inode_cache", sizeof(struct inode),
	inode_cachep = kmem_cache_create("inode_cache",
				0, SLAB_RECLAIM_ACCOUNT|SLAB_PANIC, init_once, NULL);
					 sizeof(struct inode),
					 0,
					 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
					 SLAB_MEM_SPREAD),
					 init_once,
					 NULL);
	set_shrinker(DEFAULT_SEEKS, shrink_icache_memory);
	set_shrinker(DEFAULT_SEEKS, shrink_icache_memory);


	/* Hash may have been set up in inode_init_early */
	/* Hash may have been set up in inode_init_early */
+1 −1
Original line number Original line Diff line number Diff line
@@ -100,7 +100,7 @@ extern void kmem_free(void *, size_t);


#define KM_ZONE_HWALIGN	SLAB_HWCACHE_ALIGN
#define KM_ZONE_HWALIGN	SLAB_HWCACHE_ALIGN
#define KM_ZONE_RECLAIM	SLAB_RECLAIM_ACCOUNT
#define KM_ZONE_RECLAIM	SLAB_RECLAIM_ACCOUNT
#define KM_ZONE_SPREAD	0
#define KM_ZONE_SPREAD	SLAB_MEM_SPREAD


#define kmem_zone	kmem_cache
#define kmem_zone	kmem_cache
#define kmem_zone_t	struct kmem_cache
#define kmem_zone_t	struct kmem_cache