From: Christoph Lameter <clameter@sgi.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linux-mm <linux-mm@kvack.org>, Linus Torvalds <torvalds@osdl.org>,
Andrew Morton <akpm@osdl.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: inactive-clean list
Date: Tue, 18 Jul 2006 06:29:32 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0607180557440.30245@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <1153224998.2041.15.camel@lappy>
On Tue, 18 Jul 2006, Peter Zijlstra wrote:
> > I thought we wanted to just track the number of unmapped clean pages and
> > insure that they do not go under a certain limit? That would not require
> > any locking changes but just a new zoned counter and a check in the dirty
> > handling path.
>
> The problem I see with that is that we cannot create new unmapped clean
> pages. Where will we get new pages to satisfy our demand when there is
> nothing mmap'ed.
Hmmm... I am not sure that we both have this straight yet.
Adding logic to determine the number of clean pages is not necessary. The
number of clean pages in the pagecache can be determined by:
global_page_state(NR_FILE_PAGES) - global_page_state(NR_FILE_DIRTY)
That number can be increased by writeout and so I think we want this to
be checked in the throttling path. Swapout is only useful for
anonymous pages. Dirty anonymous pages are not tracked and do not
contribute to the NR_FILE_DIRTY (formerly nr_dirty). We only track
the number of anonymous pages in NR_ANON_PAGES. Swapout could be used
to reduce NR_ANON_PAGES if memory becomes tight.
The intend of insuring that a certain number of clean pages exist seems to
be to guarantee that a certain amount of memory is freeable without
having to go through a filesystem.
Pages that are available without file system activity are:
1. The already free pages.
2. The clean pagecache pages.
For a zone this is
zone->free_pages + zone_page_state(zone, NR_FILE_PAGES) -
zone_page_state(zone, NR_FILE_DIRTY)
If this goes below a certain limit then we either have to:
1. If NR_FILE_DIRTY is significant then we can increase the number
of reclaimable pages by writing them out.
2. If NR_FILE_DIRTY and NR_FILE_PAGES are low then writeout does
not help us. NR_ANON_PAGES is likely big. So we could swap some
anonymous pages out to increase zone->free_pages instead. Performance
wise this is a bad move. So we should prefer writeout.
However, the above scheme assumes that all pagecache pages can ne
unmapped if necessary. This may not be desirable since we may then
have no executable pages available anymore and create a significant
amount of disk traffic. If we would track the number of dirty unmapped
pages (by addding NR_UNMAPPED_DIRTY) then we could guarantee available
memory that would leave the pages in use by processes alone.
If we impose a limit on the number of free pages + the number of unmapped
clean pagecache pages then we have a reserve memory pool that can be
accessed without too much impact on performance. Its basically another
trigger for writeout.
--
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:[~2006-07-18 13:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-17 20:24 Peter Zijlstra
2006-07-18 3:37 ` Christoph Lameter
2006-07-18 12:16 ` Peter Zijlstra
2006-07-18 13:29 ` Christoph Lameter [this message]
2006-07-18 13:55 ` Martin J. Bligh
2006-07-18 13:59 ` Christoph Lameter
2006-07-18 15:12 ` Martin J. Bligh
2006-07-18 15:57 ` Christoph Lameter
2006-07-18 16:23 ` Martin J. Bligh
2006-07-18 14:03 ` Christoph Lameter
2006-07-18 14:25 ` Andrew Morton
2006-07-18 14:45 ` Christoph Lameter
2006-07-18 15:59 ` KAMEZAWA Hiroyuki
2006-07-23 5:50 ` Rik van Riel
2006-07-24 18:11 ` Christoph Lameter
2006-07-24 19:00 ` Rik van Riel
2006-07-25 20:25 ` Christoph Lameter
2006-07-25 21:37 ` Rik van Riel
2006-07-25 23:03 ` Christoph Lameter
2006-07-26 0:02 ` Rik van Riel
2006-07-26 0:05 ` Christoph Lameter
2006-07-26 11:00 ` Martin Schwidefsky
2006-07-26 11:11 ` Peter Zijlstra
2006-07-26 13:04 ` Martin Schwidefsky
2006-07-26 14:45 ` Peter Zijlstra
2006-07-27 11:16 ` Martin Schwidefsky
2006-07-26 15:41 ` 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.0607180557440.30245@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@osdl.org \
/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