From: Nick Piggin <piggin@cyberone.com.au>
To: Nick Piggin <piggin@cyberone.com.au>
Cc: Matthias Urlichs <smurf@smurf.noris.de>,
linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] 2.6.4-rc2-mm1: vm-split-active-lists
Date: Sat, 13 Mar 2004 01:15:13 +1100 [thread overview]
Message-ID: <4051C5F1.2050605@cyberone.com.au> (raw)
In-Reply-To: <4051B0C6.2070302@cyberone.com.au>
[-- Attachment #1: Type: text/plain, Size: 1336 bytes --]
Nick Piggin wrote:
>
> Well if nothing at all happens we don't swap out, but when something
> is happening, desktop users don't want any of their programs to be
> swapped out no matter how long they have been sitting idle. They don't
> want to wait 10 seconds to page something in even if it means they're
> waiting an extra 10 minutes throughout the day for their kernel greps
> and diffs to finish.
>
>
Just had a try of doing things like updatedb and dd if=/dev/zero of=./blah
It is pretty swappy I guess. The following patch I think makes things less
swappy. It still isn't true dropbehind because new unmapped pages still do
place some pressure on the more established pagecache, but not as much.
It is unclear whether full dropbehind is actually good or not. If you have
512MB of memory and a 256MB working set of file data (unmapped), with 400MB
of mapped memory doing nothing, after enough thrashing through your 256MB,
you'd expect some of that mapped memory to be swapped out.
By the way, I would be interested to know the rationale behind
mark_page_accessed as it is without this patch, also what is it doing in
rmap.c (I know hardly anything actually uses page_test_and_clear_young, but
still). It seems to me like it only serves to make VM behaviour harder to
understand, but I'm probably missing something. Andrew?
[-- Attachment #2: vm-dropbehind.patch --]
[-- Type: text/x-patch, Size: 1638 bytes --]
linux-2.6-npiggin/mm/filemap.c | 3 +--
linux-2.6-npiggin/mm/rmap.c | 2 +-
linux-2.6-npiggin/mm/swap.c | 7 +------
3 files changed, 3 insertions(+), 9 deletions(-)
diff -puN mm/filemap.c~vm-dropbehind mm/filemap.c
--- linux-2.6/mm/filemap.c~vm-dropbehind 2004-03-13 00:14:56.000000000 +1100
+++ linux-2.6-npiggin/mm/filemap.c 2004-03-13 00:55:17.000000000 +1100
@@ -662,8 +662,7 @@ page_ok:
/*
* Mark the page accessed if we read the beginning.
*/
- if (!offset)
- mark_page_accessed(page);
+ mark_page_accessed(page);
/*
* Ok, we have the page, and it's up-to-date, so
diff -puN mm/swap.c~vm-dropbehind mm/swap.c
--- linux-2.6/mm/swap.c~vm-dropbehind 2004-03-13 00:17:29.000000000 +1100
+++ linux-2.6-npiggin/mm/swap.c 2004-03-13 00:18:11.000000000 +1100
@@ -111,13 +111,8 @@ void fastcall activate_page(struct page
*/
void fastcall mark_page_accessed(struct page *page)
{
- if (!PageActiveMapped(page) && !PageActiveUnmapped(page)
- && PageReferenced(page) && PageLRU(page)) {
- activate_page(page);
- ClearPageReferenced(page);
- } else if (!PageReferenced(page)) {
+ if (!PageReferenced(page))
SetPageReferenced(page);
- }
}
EXPORT_SYMBOL(mark_page_accessed);
diff -puN mm/rmap.c~vm-dropbehind mm/rmap.c
--- linux-2.6/mm/rmap.c~vm-dropbehind 2004-03-13 01:08:00.000000000 +1100
+++ linux-2.6-npiggin/mm/rmap.c 2004-03-13 01:08:28.000000000 +1100
@@ -118,7 +118,7 @@ int fastcall page_referenced(struct page
int referenced = 0;
if (page_test_and_clear_young(page))
- mark_page_accessed(page);
+ referenced++;
if (TestClearPageReferenced(page))
referenced++;
_
next prev parent reply other threads:[~2004-03-12 14:15 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-11 0:04 [PATCH] 2.6.4-rc2-mm1: vm-split-active-lists Nick Piggin
2004-03-11 17:25 ` Marc-Christian Petersen
2004-03-12 9:09 ` Nick Piggin
2004-03-12 9:27 ` Andrew Morton
2004-03-12 9:37 ` Nick Piggin
2004-03-12 11:08 ` Matthias Urlichs
2004-03-12 11:47 ` Jamie Lokier
2004-03-12 12:44 ` Nick Piggin
2004-03-12 14:15 ` Nick Piggin [this message]
2004-03-12 15:05 ` Nikita Danilov
2004-03-12 15:28 ` Nick Piggin
2004-03-12 16:31 ` Nikita Danilov
2004-03-12 23:05 ` Nick Piggin
2004-03-12 19:12 ` Andrew Morton
2004-03-12 23:23 ` Nick Piggin
2004-03-12 19:12 ` Bill Davidsen
2004-03-12 23:50 ` Nick Piggin
2004-03-12 21:46 ` Pavel Machek
-- strict thread matches above, loose matches on Subject: below --
2004-03-12 14:18 Mark_H_Johnson
2004-03-12 14:27 ` Nick Piggin
2004-03-12 19:46 ` Jamie Lokier
2004-03-12 15:00 Mark_H_Johnson
2004-03-12 15:13 ` Nick Piggin
2004-03-12 19:35 ` Jamie Lokier
2004-03-12 21:17 ` Mike Fedyk
2004-03-12 22:21 ` Jamie Lokier
2004-03-12 22:36 ` Mike Fedyk
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=4051C5F1.2050605@cyberone.com.au \
--to=piggin@cyberone.com.au \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=smurf@smurf.noris.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