[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <456F014C.5040200@redhat.com>
Date: Thu, 30 Nov 2006 11:05:32 -0500
From: Wendy Cheng <wcheng@...hat.com>
To: wcheng@...hat.com, Andrew Morton <akpm@...l.org>
CC: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] prune_icache_sb
How about a simple and plain change with this uploaded patch ....
The idea is, instead of unconditionally dropping every buffer associated
with the particular mount point (that defeats the purpose of page
caching), base kernel exports the "drop_pagecache_sb()" call that allows
page cache to be trimmed. More importantly, it is changed to offer the
choice of not randomly purging any buffer but the ones that seem to be
unused (i_state is NULL and i_count is zero). This will encourage
filesystem(s) to pro actively response to vm memory shortage if they
choose so.
From our end (cluster locks are expensive - that's why we cache them),
one of our kernel daemons will invoke this newly exported call based on
a set of pre-defined tunables. It is then followed by a lock reclaim
logic to trim the locks by checking the page cache associated with the
inode (that this cluster lock is created for). If nothing is attached to
the inode (based on i_mapping->nrpages count), we know it is a good
candidate for trimming and will subsequently drop this lock (instead of
waiting until the end of vfs inode life cycle).
Note that I could do invalidate_inode_pages() within our kernel modules
to accomplish what drop_pagecache_sb() does (without coming here to bug
people) but I don't have access to inode_lock as an external kernel
module. So either EXPORT_SYMBOL(inode_lock) or this patch ?
The end result (of this change) should encourage filesystem to actively
avoid depleting too much memory and we'll encourage our applications to
understand clustering locality issues.
Haven't tested this out though - would appreciate some comments before
spending more efforts on this direction.
-- Wendy
View attachment "inode_prune_sb.patch" of type "text/x-patch" (1724 bytes)
Powered by blists - more mailing lists