From: Christoph Lameter <clameter@engr.sgi.com>
To: Nick Piggin <npiggin@suse.de>
Cc: Linux Memory Management List <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [rfc][patch 2/2] mm: mlocked pages off LRU
Date: Mon, 5 Mar 2007 10:14:58 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0703050948040.6620@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070305161746.GD8128@wotan.suse.de>
On Mon, 5 Mar 2007, Nick Piggin wrote:
> - PageMLock explicitly elevates the page's refcount, so PageMLock pages
> don't ever get freed (thus requires less awareness in the rest of mm).
Which breaks page migration for mlocked pages.
I think there is still some thinking going on about also removing
anonymous pages off the LRU if we are out of swap or have no swap. In
that case we may need page->lru to track these pages so that they can be
fed back to the LRU when swap is added later.
I was a bit hesitant to use an additional ref counter because we are here
overloading a refcounter on a LRU field? I have a bad feeling here. There
are possible race conditions and it seems that earlier approaches failed
to address those.
> +static void inc_page_mlock(struct page *page)
> +{
> + BUG_ON(!PageLocked(page));
> +
> + if (!PageMLock(page)) {
> + if (!isolate_lru_page(page)) {
> + SetPageMLock(page);
> + get_page(page);
> + set_page_mlock_count(page, 1);
> + }
> + } else if (PageMLock(page)) {
You already checked for !PageMlock so PageMlock is true.
> - if (!migration && ((vma->vm_flags & VM_LOCKED) ||
> - (ptep_clear_flush_young(vma, address, pte)))) {
> - ret = SWAP_FAIL;
> - goto out_unmap;
> + if (!migration) {
> + if (vma->vm_flags & VM_LOCKED) {
> + ret = SWAP_MLOCK;
> + goto out_unmap;
> + }
> + if (ptep_clear_flush_young(vma, address, pte)) {
> + ret = SWAP_FAIL;
> + goto out_unmap;
> + }
Ok you basically keep the first patch of my set. Maybe include that
explicitly ?
> /*
> + * This routine is used to map in an anonymous page into an address space:
> + * needed by execve() for the initial stack and environment pages.
Could we have some common code that also covers do_anonymous page etc?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-03-05 18:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-05 16:17 Nick Piggin
2007-03-05 16:40 ` Nick Piggin
2007-03-05 17:12 ` Christoph Hellwig
2007-03-05 18:17 ` Christoph Lameter
2007-03-05 18:14 ` Christoph Lameter [this message]
2007-03-05 19:26 ` Rik van Riel
2007-03-06 1:05 ` Nick Piggin
2007-03-06 1:27 ` Christoph Lameter
2007-03-06 1:44 ` Nick Piggin
2007-03-06 1:55 ` Christoph Lameter
2007-03-06 2:13 ` Nick Piggin
2007-03-06 2:46 ` Christoph Lameter
2007-03-06 2:50 ` Nick Piggin
2007-03-06 14:30 ` Nick Piggin
2007-03-06 18:30 ` Christoph Lameter
2007-03-07 3:07 ` Nick Piggin
2007-03-06 22:23 ` Lee Schermerhorn
2007-03-07 3:52 ` Nick Piggin
2007-03-06 15:59 ` 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.64.0703050948040.6620@schroedinger.engr.sgi.com \
--to=clameter@engr.sgi.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
/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