All of lore.kernel.org
 help / color / mirror / Atom feed
* How to reclaim inode pages on demand
@ 2005-08-08 15:52 Mel Gorman
  2005-08-08 16:08 ` Jörn Engel
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Mel Gorman @ 2005-08-08 15:52 UTC (permalink / raw)
  To: Linux Kernel Mailing List

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?

-- 
Mel Gorman
Part-time Phd Student                          Java Applications Developer
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-08 15:52 How to reclaim inode pages on demand 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-09  4:06 ` Rik van Riel
  2 siblings, 1 reply; 18+ messages in thread
From: Jörn Engel @ 2005-08-08 16:08 UTC (permalink / raw)
  To: Mel Gorman; +Cc: Linux Kernel Mailing List

On Mon, 8 August 2005 16:52:52 +0100, Mel Gorman wrote:
> 
> 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?

A struct page ain't an inode.  So I'm assuming you mean something like
"giving a struct page that is known to be part of the inode slab
cache".

In that case, you have to decide how intimate you want the slab code
and your page/inode reclaim code to be.  You could use slab structures
to find out the (ofs,len) tupel of contained structures, cast those
to a struct inode and then continue.  Whether you actually want that,
depends on your moral standards.

Jörn

-- 
I don't understand it. Nobody does.
-- Richard P. Feynman

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-08 16:08 ` Jörn Engel
@ 2005-08-08 16:23   ` Mel Gorman
  0 siblings, 0 replies; 18+ messages in thread
From: Mel Gorman @ 2005-08-08 16:23 UTC (permalink / raw)
  To: Jörn Engel; +Cc: Linux Kernel Mailing List

On Mon, 8 Aug 2005, Jörn Engel wrote:

> On Mon, 8 August 2005 16:52:52 +0100, Mel Gorman wrote:
> >
> > 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?
>
> A struct page ain't an inode.  So I'm assuming you mean something like
> "giving a struct page that is known to be part of the inode slab
> cache".
>

I explained this badly.

Inodes have access to an address_space via inode->i_data. This
address_space is used to allocate pages from functions like
page_cache_alloc() or grab_cache_page(). It is these pages that are the
problem, not the slab pages holding the inode structures. The question is
how these pages can be directly reclaimed. Does anyone have suggestions?


-- 
Mel Gorman
Part-time Phd Student                          Java Applications Developer
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-08 15:52 How to reclaim inode pages on demand Mel Gorman
  2005-08-08 16:08 ` Jörn Engel
@ 2005-08-08 23:08 ` Andrew Morton
  2005-08-10 16:32   ` Mel Gorman
  2005-08-09  4:06 ` Rik van Riel
  2 siblings, 1 reply; 18+ messages in thread
From: Andrew Morton @ 2005-08-08 23:08 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-kernel

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).

Problem: races.  If you pick a random page up off the LRU and start playing
with its mapping, what stops that mapping from getting freed under your
feet?

If the caller has a ref on the inode (say, you came in via a syscall
against an fd) then fine.

But if you picked the page up off the LRU then to avoid super-rare oopses
you'll need to pin the address_space somehow.  One way is to

a) lock the page, which pins the address_space.

b) check that page->mapping is still non-NULL.  Bale if it is.

c) bump page->mapping->host->i_count

d) unlock the page

e) diddle away with the address_space.

f) iput() the inode.

But beware that iput() can do a *ton* of stuff, so you need to be not
holding any locks and to not be called from any fancy contexts.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-08 15:52 How to reclaim inode pages on demand Mel Gorman
  2005-08-08 16:08 ` Jörn Engel
  2005-08-08 23:08 ` Andrew Morton
@ 2005-08-09  4:06 ` Rik van Riel
  2 siblings, 0 replies; 18+ messages in thread
From: Rik van Riel @ 2005-08-09  4:06 UTC (permalink / raw)
  To: Mel Gorman; +Cc: Linux Kernel Mailing List

On Mon, 8 Aug 2005, Mel Gorman wrote:

> 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?

Note that you can only free the inodes that aren't currently
open files for any of the processes in the system.

-- 
All Rights Reversed

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-08 23:08 ` Andrew Morton
@ 2005-08-10 16:32   ` Mel Gorman
  2005-08-10 17:17     ` Andrew Morton
  0 siblings, 1 reply; 18+ messages in thread
From: Mel Gorman @ 2005-08-10 16:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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?

> Problem: races.  If you pick a random page up off the LRU and start playing
> with its mapping, what stops that mapping from getting freed under your
> feet?
>

Nothing at all, which explains why I occasionally got oops when I was
trying to free pages with the mapping set. I am going to follow your
suggestions and see how I get on.

If it is still not working out, I will try reclaiming when the workload is
something other than a large number of kernel compiles to see if I am on
the right track at all.

Thanks a lot

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-10 16:32   ` Mel Gorman
@ 2005-08-10 17:17     ` Andrew Morton
  2005-08-10 17:27       ` Mel Gorman
  2005-08-11  3:08       ` Magnus Damm
  0 siblings, 2 replies; 18+ messages in thread
From: Andrew Morton @ 2005-08-10 17:17 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-kernel

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.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  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:50         ` Dave Hansen
  2005-08-11  3:08       ` Magnus Damm
  1 sibling, 2 replies; 18+ messages in thread
From: Mel Gorman @ 2005-08-10 17:27 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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.

-- 
Mel Gorman
Part-time Phd Student                          Java Applications Developer
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-10 17:27       ` Mel Gorman
@ 2005-08-10 17:40         ` Andrew Morton
  2005-08-10 17:51           ` Mel Gorman
  2005-08-10 17:50         ` Dave Hansen
  1 sibling, 1 reply; 18+ messages in thread
From: Andrew Morton @ 2005-08-10 17:40 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-kernel

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.

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.

You cold lock the pages then check ->mapping.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-10 17:27       ` Mel Gorman
  2005-08-10 17:40         ` Andrew Morton
@ 2005-08-10 17:50         ` Dave Hansen
  2005-08-10 17:59           ` Mel Gorman
  1 sibling, 1 reply; 18+ messages in thread
From: Dave Hansen @ 2005-08-10 17:50 UTC (permalink / raw)
  To: Mel Gorman; +Cc: Andrew Morton, Linux Kernel Mailing List

On Wed, 2005-08-10 at 18:27 +0100, Mel Gorman wrote:
> 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.

How about putting a check for PG_inode and a periodic dump_stack()
wherever page->mapping is cleared?  That should at least let you catch
the culprit who is clearing them. __remove_from_page_cache() is the only
real place I see this being done.

Are you remembering to clean PG_inode when a page is freed?  Perhaps
it's allocated for the page cache, reclaimed, returned to the allocator,
and reallocated as anonymous memory where you're seeing the null
->mapping.  Might want to check for PG_inode in free_pages_check().

-- Dave


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-10 17:40         ` Andrew Morton
@ 2005-08-10 17:51           ` Mel Gorman
  2005-08-10 17:52             ` Andrew Morton
  0 siblings, 1 reply; 18+ messages in thread
From: Mel Gorman @ 2005-08-10 17:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-10 17:51           ` Mel Gorman
@ 2005-08-10 17:52             ` Andrew Morton
  0 siblings, 0 replies; 18+ messages in thread
From: Andrew Morton @ 2005-08-10 17:52 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-kernel

Mel Gorman <mel@csn.ul.ie> wrote:
>
> > 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?

Yup.  unlink() does truncate if it unlinked the final link.

> In case it is journalling-related, I am going to rerun the tests on an
> ext2 filesystem over the weekend.

Good idea.


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-10 17:50         ` Dave Hansen
@ 2005-08-10 17:59           ` Mel Gorman
  0 siblings, 0 replies; 18+ messages in thread
From: Mel Gorman @ 2005-08-10 17:59 UTC (permalink / raw)
  To: Dave Hansen; +Cc: Andrew Morton, Linux Kernel Mailing List

On Wed, 10 Aug 2005, Dave Hansen wrote:

> On Wed, 2005-08-10 at 18:27 +0100, Mel Gorman wrote:
> > 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.
>
> How about putting a check for PG_inode and a periodic dump_stack()
> wherever page->mapping is cleared?  That should at least let you catch
> the culprit who is clearing them. __remove_from_page_cache() is the only
> real place I see this being done.
>

Will do, it might shed some light on whats happening.

> Are you remembering to clean PG_inode when a page is freed?

Yes, I was using the allocator to count how many inode-related pages there
were in the system. The answer was lots, another reason why I'm thinking
that I picked the worst possible benchmark to test this stuff with.

> Perhaps
> it's allocated for the page cache, reclaimed, returned to the allocator,
> and reallocated as anonymous memory where you're seeing the null
> ->mapping.  Might want to check for PG_inode in free_pages_check().
>

I am 99.99% certain I make that check but I can't double check the code
until late in the weekend.

-- 
Mel Gorman
Part-time Phd Student                          Java Applications Developer
University of Limerick                         IBM Dublin Software Lab

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-10 17:17     ` Andrew Morton
  2005-08-10 17:27       ` Mel Gorman
@ 2005-08-11  3:08       ` Magnus Damm
  2005-08-11  4:44         ` Andrew Morton
  1 sibling, 1 reply; 18+ messages in thread
From: Magnus Damm @ 2005-08-11  3:08 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Mel Gorman, linux-kernel

On 8/11/05, Andrew Morton <akpm@osdl.org> wrote:
> Mel Gorman <mel@csn.ul.ie> wrote:
> > 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.

I thought page->mapping was used by rmap for both inode-backed and
anonymous pages. And the PAGE_MAPPING_ANON bit was used to determine
that page->mapping points to struct anon_vma instead of struct
address_space.

When is page->mapping NULL?

/ magnus

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  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
  0 siblings, 2 replies; 18+ messages in thread
From: Andrew Morton @ 2005-08-11  4:44 UTC (permalink / raw)
  To: Magnus Damm; +Cc: mel, linux-kernel

Magnus Damm <magnus.damm@gmail.com> wrote:
>
> On 8/11/05, Andrew Morton <akpm@osdl.org> wrote:
> > Mel Gorman <mel@csn.ul.ie> wrote:
> > > 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.
> 
> I thought page->mapping was used by rmap for both inode-backed and
> anonymous pages. And the PAGE_MAPPING_ANON bit was used to determine
> that page->mapping points to struct anon_vma instead of struct
> address_space.
> 
> When is page->mapping NULL?
> 

mm.h:page_mapping() handles all that.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-11  4:44         ` Andrew Morton
@ 2005-08-11  5:43           ` Magnus Damm
  2005-08-11  9:09           ` Coywolf Qi Hunt
  1 sibling, 0 replies; 18+ messages in thread
From: Magnus Damm @ 2005-08-11  5:43 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mel, linux-kernel

On 8/11/05, Andrew Morton <akpm@osdl.org> wrote:
> Magnus Damm <magnus.damm@gmail.com> wrote:
> >
> > On 8/11/05, Andrew Morton <akpm@osdl.org> wrote:
> > > Mel Gorman <mel@csn.ul.ie> wrote:
> > > > 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.
> >
> > I thought page->mapping was used by rmap for both inode-backed and
> > anonymous pages. And the PAGE_MAPPING_ANON bit was used to determine
> > that page->mapping points to struct anon_vma instead of struct
> > address_space.
> >
> > When is page->mapping NULL?
> >
> 
> mm.h:page_mapping() handles all that.

Yes, thanks, but I believe that page->mapping is never NULL for
anonymous pages. Does not all anonymous pages have page->mapping
pointing to struct anon_vma?

/ magnus

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  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
  1 sibling, 1 reply; 18+ messages in thread
From: Coywolf Qi Hunt @ 2005-08-11  9:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Magnus Damm, mel, linux-kernel

On 8/11/05, Andrew Morton <akpm@osdl.org> wrote:
> Magnus Damm <magnus.damm@gmail.com> wrote:
> >
> > On 8/11/05, Andrew Morton <akpm@osdl.org> wrote:
> > > Mel Gorman <mel@csn.ul.ie> wrote:
> > > > 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.
> >
> > I thought page->mapping was used by rmap for both inode-backed and
> > anonymous pages. And the PAGE_MAPPING_ANON bit was used to determine
> > that page->mapping points to struct anon_vma instead of struct
> > address_space.
> >
> > When is page->mapping NULL?
> >
> 
> mm.h:page_mapping() handles all that.

at http://sosdg.org/~coywolf/lxr/source/include/linux/mm.h#L561
Should the comment be s/page_mapped/page->mapping/ ?

-- 
Coywolf Qi Hunt
http://ahbl.org/~coywolf/

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: How to reclaim inode pages on demand
  2005-08-11  9:09           ` Coywolf Qi Hunt
@ 2005-08-11 14:09             ` Hugh Dickins
  0 siblings, 0 replies; 18+ messages in thread
From: Hugh Dickins @ 2005-08-11 14:09 UTC (permalink / raw)
  To: coywolf; +Cc: Andrew Morton, Magnus Damm, mel, linux-kernel

On Thu, 11 Aug 2005, Coywolf Qi Hunt wrote:
> 
> at http://sosdg.org/~coywolf/lxr/source/include/linux/mm.h#L561
> Should the comment be s/page_mapped/page->mapping/ ?

No.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-08-11 14:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-08 15:52 How to reclaim inode pages on demand 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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.