All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-kernel@vger.kernel.org,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Rik van Riel <riel@redhat.com>
Subject: Re: [RFC] Tracking mlocked pages and moving them off the LRU
Date: Sat, 3 Feb 2007 00:53:16 -0800	[thread overview]
Message-ID: <20070203005316.eb0b4042.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0702022214580.3960@schroedinger.engr.sgi.com>

On Fri, 2 Feb 2007 22:20:12 -0800 (PST) Christoph Lameter <clameter@sgi.com> wrote:

> This is a new variation on the earlier RFC for tracking mlocked pages.
> We now mark a mlocked page with a bit in the page flags and remove
> them from the LRU. Pages get moved back when no vma that references
> the page has VM_LOCKED set anymore.
> 
> This means that vmscan no longer uselessly cycles over large amounts
> of mlocked memory should someone attempt to mlock large amounts of
> memory (may even result in a livelock on large systems).
> 
> Synchronization is build around state changes of the PageMlocked bit.
> The NR_MLOCK counter is incremented and decremented based on
> state transitions of PageMlocked. So the count is accurate.

I wonder if it can be simpler.  Make two changes:

a) If the scanner encounters an mlocked page on the LRU, take it off.

b) munlock() adds all affected pages to the LRU.

And that's it.  Simpler, solves the uselessly-scan-lots-of-mlocked-pages
problem (which is the sole requirement according to your description) and
doesn't consume a page flag.  Optional (and arguable) extension: scan the
vmas during munmap, don't add page to LRU if it's still mlocked.

Why _does_ your patch add a new page flag?  That info is available via a
vma scan.

> There is still some unfinished business:
> 
> 1. We use the 21st page flag and we only have 20 on 32 bit NUMA platforms.

Ow.  How were you thinking of fixing that?

> 2. Since mlocked pages are now off the LRU page migration will no longer
>    move them.

Ow.  That could be a right pain when we get around to using migration for
memory-unplug?


  reply	other threads:[~2007-02-03  8:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-03  6:20 [RFC] Tracking mlocked pages and moving them off the LRU Christoph Lameter
2007-02-03  8:53 ` Andrew Morton [this message]
2007-02-03 17:56   ` Christoph Lameter
2007-02-03 18:04     ` Arjan van de Ven
2007-02-03 18:09       ` Christoph Lameter
2007-02-03 18:55       ` Christoph Lameter
2007-02-03 19:03       ` Christoph Lameter
2007-02-04  1:22         ` Andrew Morton
2007-02-04  1:49           ` Christoph Lameter
2007-02-04  8:16             ` Arjan van de Ven
2007-02-05  6:45               ` Christoph Lameter
2007-02-06 22:05                 ` Nate Diller
2007-02-07  8:02                   ` Christoph Lameter
2007-02-07 18:39                     ` Nate Diller
2007-02-05  7:57               ` Christoph Lameter
2007-02-05  8:39                 ` Arjan van de Ven
2007-02-05 16:38                   ` Matt Mackall
2007-02-05 17:34                     ` Christoph Lameter
2007-02-05 19:04                     ` Christoph Lameter
2007-02-05 17:33                   ` Christoph Lameter
2007-02-03 22:58   ` Nigel Cunningham
2007-02-03 10:16 ` Christoph Hellwig
2007-02-03 15:35   ` Martin J. Bligh
2007-02-03 17:59     ` Christoph Lameter
2007-02-03 17:33   ` Christoph Lameter
2007-02-03 22:56 ` Nigel Cunningham

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=20070203005316.eb0b4042.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=riel@redhat.com \
    /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 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.