From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: [patch 16/21] Filesystem: /proc filesystem support for slab defrag Date: Fri, 09 May 2008 20:08:47 -0700 Message-ID: <20080510030918.409594225@sgi.com> References: <20080510030831.796641881@sgi.com> Cc: linux-kernel@vger.kernel.org, Alexey Dobriyan To: akpm@linux-foundation.org Return-path: Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:55070 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753013AbYEJDJV (ORCPT ); Fri, 9 May 2008 23:09:21 -0400 CC: linux-fsdevel@vger.kernel.org Cc: Mel Gorman Cc: andi@firstfloor.org Cc: Rik van Riel Cc: Pekka Enberg Cc: mpm@selenic.com Content-Disposition: inline; filename=0028-FS-Proc-filesystem-support-for-slab-defrag.patch Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Support procfs inode defragmentation Cc: Alexey Dobriyan Reviewed-by: Rik van Riel Signed-off-by: Christoph Lameter --- fs/proc/inode.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 82b3a1b..5bc8d23 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -104,6 +104,12 @@ static void init_once(struct kmem_cache * cachep, void *foo) inode_init_once(&ei->vfs_inode); } +static void *proc_get_inodes(struct kmem_cache *s, int nr, void **v) +{ + return fs_get_inodes(s, nr, v, + offsetof(struct proc_inode, vfs_inode)); +}; + int __init proc_init_inodecache(void) { proc_inode_cachep = kmem_cache_create("proc_inode_cache", @@ -111,6 +117,8 @@ int __init proc_init_inodecache(void) 0, (SLAB_RECLAIM_ACCOUNT| SLAB_MEM_SPREAD|SLAB_PANIC), init_once); + kmem_cache_setup_defrag(proc_inode_cachep, + proc_get_inodes, kick_inodes); return 0; } -- 1.5.4.4 --