[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080513140902.1030afaa@cuia.bos.redhat.com>
Date: Tue, 13 May 2008 14:09:02 -0400
From: Rik van Riel <riel@...hat.com>
To: Lee Schermerhorn <Lee.Schermerhorn@...com>
Cc: Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
akpm@...ux-foundation.org, kosaki.motohiro@...fujitsu.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] take pageout refcount into account for
remove_exclusive_swap_page
On Tue, 13 May 2008 13:43:55 -0400
Lee Schermerhorn <Lee.Schermerhorn@...com> wrote:
> Or, more generally, 2 + N, for an anon page that is mapped [must be
> read-only, right?] by N processes. This can happen after, e.g., fork().
> Looks like this patch handles the condition just fine, but you might
> want to reflect this in the comment.
No, this patch only removes a page from the swap cache that is mapped
by one process. The function page_mapped() returns either 1 or 0, not
the same as page_mapcount().
I am not sure if trying to handle swap cache pages that are mapped by
multiple processes could get us into other corner cases and think that
we should probably try to stick to the safe thing for now.
Besides, shouldn't anonymous shared pages be COW and relatively rare?
> Now, I think I can use this to try to remove anon pages from the swap
> cache when they're mlocked.
>
> > + */
> > +int remove_exclusive_swap_page_ref(struct page *page)
> > +{
> > + return remove_exclusive_swap_page_count(page, 2 + page_mapped(page));
> > +}
> > +
> > +/*
> > * Free the swap entry like above, but also try to
> > * free the page cache entry if it is the last user.
> > */
> >
> > All Rights Reversed
--
All Rights Reversed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists