From: Mel Gorman <mel@csn.ul.ie>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to reclaim inode pages on demand
Date: Wed, 10 Aug 2005 18:51:49 +0100 (IST) [thread overview]
Message-ID: <Pine.LNX.4.58.0508101845190.11984@skynet> (raw)
In-Reply-To: <20050810104044.1e0da3e6.akpm@osdl.org>
On Wed, 10 Aug 2005, Andrew Morton wrote:
> Mel Gorman <mel@csn.ul.ie> wrote:
> >
> > On Wed, 10 Aug 2005, Andrew Morton wrote:
> >
> > > Mel Gorman <mel@csn.ul.ie> wrote:
> > > >
> > > > On Mon, 8 Aug 2005, Andrew Morton wrote:
> > > >
> > > > > Mel Gorman <mel@csn.ul.ie> wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I am working on a direct reclaim strategy to free up large blocks of
> > > > > > contiguous pages. The part I have is working fine, but I am finding a
> > > > > > hundreds of pages that are being used for inodes that I need to reclaim. I
> > > > > > tried purging the inode lists using a variation of prune_icache() but it
> > > > > > is not working out.
> > > > > >
> > > > > > Given a struct page, that one knows is an inode, can anyone suggest the
> > > > > > best way to find the inode using it and free it?
> > > > >
> > > > > Simple answer: invalidate_mapping_pages(page->mapping, start, end).
> > > > >
> > > >
> > > > The majority of pages I am seeing no longer have page->mapping set. Does
> > > > this mean they are in the process of being cleared up?
> > >
> > > They're just anonymous pages, aren't they? But you said "pages that are
> > > being used for inodes". Confused.
> > >
> >
> > So am I, I'm missing something really stupid.
> >
> > What I have is the following;
> >
> > 1. Add a new flag GFP_INODE to mark inode pages
> > 2. Add a GFP_INODE to the flags passed to mapping_set_gfp_mask() in
> > fs/inode.c#alloc_inode(). This means that the page allocator will now
> > know when it is allocating pages for inodes
> > 3. Added a PG_inode flag for page->flags which will flag all pages that
> > were allocated for inodes
> >
> > (Note, I don't intend to use this flags in the long term, I've added them
> > for investigation purposes).
> >
> > I later linearly scan the mem_map looking for pages that can be freed up
> > (usually LRU pages). I was expecting any page with PG_inode set to have a
> > page->mapping but not all of them do. It is the pages without a ->mapping
> > that are confusing the hell out of me.
>
> Well there are conditions in which mmapped file pages can get converted to
> anonymous pages due to truncate(), but I have a feeling that we stopped
> that from happening.
>
Does that also apply to when a file is unlinked rather than truncated? As
the load is a lot of kernel compiles, there are a lot of files being
created and deleted shortly afterwards.
> Also there are situations in which truncate of a still-committing ext3
> pagecache page can cause the page to remain ont he page LRUs - it's been
> truncated from the file, but ext4 still has a hold of it for journalling
> purposes.
>
In case it is journalling-related, I am going to rerun the tests on an
ext2 filesystem over the weekend.
> You cold lock the pages then check ->mapping.
>
Will do.
--
Mel Gorman
Part-time Phd Student Java Applications Developer
University of Limerick IBM Dublin Software Lab
next prev parent reply other threads:[~2005-08-10 17:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-08 15:52 Mel Gorman
2005-08-08 16:08 ` Jörn Engel
2005-08-08 16:23 ` Mel Gorman
2005-08-08 23:08 ` Andrew Morton
2005-08-10 16:32 ` Mel Gorman
2005-08-10 17:17 ` Andrew Morton
2005-08-10 17:27 ` Mel Gorman
2005-08-10 17:40 ` Andrew Morton
2005-08-10 17:51 ` Mel Gorman [this message]
2005-08-10 17:52 ` Andrew Morton
2005-08-10 17:50 ` Dave Hansen
2005-08-10 17:59 ` Mel Gorman
2005-08-11 3:08 ` Magnus Damm
2005-08-11 4:44 ` Andrew Morton
2005-08-11 5:43 ` Magnus Damm
2005-08-11 9:09 ` Coywolf Qi Hunt
2005-08-11 14:09 ` Hugh Dickins
2005-08-09 4:06 ` Rik van Riel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0508101845190.11984@skynet \
--to=mel@csn.ul.ie \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®