From: Andrew Morton <akpm@linux-foundation.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: Arjan van de Ven <arjan@infradead.org>,
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 17:22:42 -0800 [thread overview]
Message-ID: <20070203172242.e5bf2534.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0702031055210.18224@schroedinger.engr.sgi.com>
On Sat, 3 Feb 2007 11:03:59 -0800 (PST) Christoph Lameter <clameter@sgi.com> wrote:
> Here is the second piece removing mlock pages off the LRU during scanning.
> I tried moving them to a separate list but then we run into issues with
> locking. We do not need ithe list though since we will encounter the
> page again anyways during zap_pte_range.
>
> However, in zap_pte_range we then run into another problem. Multiple
> zap_pte_ranges may handle the same page and without a page flag and
> scanning all the vmas we cannot determine if the page should or should not
> be moved back to the LRU. As a result this patch may decrement NR_MLOCK
> too much so that is goes below zero. Any ideas on how to fix this without
> a page flag and a scan over vmas?
>
> Plus there is the issue of NR_MLOCK only being updated when we are
> reclaiming and when we may already be in trouble. An app may mlock huge
> amounts of memory and NR_MLOCK will stay low. If memory gets too low then
> NR_MLOCKED is suddenly become accurate and the VM is likely undergoing a
> shock from that discovery (should we actually use NR_MLOCK elsewhere to
> determine memory management behavior). Hopefully we will not fall over
> then.
Do we actually need NR_MLOCK? Page reclaim tends to care more about the
size of the LRUs and doesn't have much dependency on ->present_pages,
iirc.
I guess we could use NR_MLOCK for writeback threshold calculations, to
force writeback earlier if there's a lot of mlocked memory in the affected
zones. But that code isn't zone-aware anyway, and we don't know how to make
it zone aware in any sane fashion and making it cpuset-aware isn't very
interesting or useful..
So.. Why do we want NR_MLOCK?
next prev parent reply other threads:[~2007-02-04 1:23 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
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 [this message]
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=20070203172242.e5bf2534.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=arjan@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox