From: Matthew Wilcox Subject: Re: freeing pagecache Date: Sun, 29 Sep 2002 14:38:07 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20020929143807.E18377@parcelfarce.linux.theplanet.co.uk> References: <3D96EB64.7020406@shaolinmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: To: David Chow Content-Disposition: inline In-Reply-To: <3D96EB64.7020406@shaolinmicro.com>; from davidchow@shaolinmicro.com on Sun, Sep 29, 2002 at 08:00:36PM +0800 List-Id: linux-fsdevel.vger.kernel.org On Sun, Sep 29, 2002 at 08:00:36PM +0800, David Chow wrote: > cache... The reason I am asking the question is that if I am safe to > make use of an unlocked mapped pagecahed page. Thanks for comments and > answers. You don't need to lock it, just bump its page count. include/linux/mm.h: * Also, many kernel routines increase the page count before a critical * routine so they can be sure the page doesn't go away from under them. */ #define get_page(p) atomic_inc(&(p)->count) #define put_page(p) __free_page(p) -- Revolutions do not require corporate support.