From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <20070618095918.199800825@sgi.com> References: <20070618095838.238615343@sgi.com> Date: Mon, 18 Jun 2007 02:58:58 -0700 From: clameter@sgi.com Subject: [patch 20/26] Slab defragmentation: Support inode defragmentation for sockets Content-Disposition: inline; filename=slub_defrag_fs_socket Sender: owner-linux-mm@kvack.org Return-Path: To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Pekka Enberg , suresh.b.siddha@intel.com List-ID: --- net/socket.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) Index: slub/net/socket.c =================================================================== --- slub.orig/net/socket.c 2007-06-06 15:19:29.000000000 -0700 +++ slub/net/socket.c 2007-06-06 15:20:54.000000000 -0700 @@ -264,6 +264,17 @@ static void init_once(void *foo, struct inode_init_once(&ei->vfs_inode); } +static void *sock_get_inodes(struct kmem_cache *s, int nr, void **v) +{ + return fs_get_inodes(s, nr, v, + offsetof(struct socket_alloc, vfs_inode)); +} + +static struct kmem_cache_ops sock_kmem_cache_ops = { + .get = sock_get_inodes, + .kick = kick_inodes +}; + static int init_inodecache(void) { sock_inode_cachep = kmem_cache_create("sock_inode_cache", @@ -273,7 +284,7 @@ static int init_inodecache(void) SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD), init_once, - NULL); + &sock_kmem_cache_ops); if (sock_inode_cachep == NULL) return -ENOMEM; return 0; -- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org