From: Nick Piggin <piggin@cyberone.com.au>
To: linux-kernel <linux-kernel@vger.kernel.org>,
Linux Memory Management <linux-mm@kvack.org>
Subject: [RFC][PATCH 0/4] VM split active lists
Date: Tue, 09 Mar 2004 16:32:08 +1100 [thread overview]
Message-ID: <404D56D8.2000008@cyberone.com.au> (raw)
Hi,
Background: there are a number of problems in the 2.6 page reclaim
algorithms. Thankfully, most of them were simple oversights or small
bugs, the worst of which Andrew Morton and myself have fixes for in
his -mm tree and being mostly simple and obviously correct, they will
hopefully be included in 2.6.5.
With these fixes, 2.6 swapping performance (the area I'm focusing on)
is very much improved. Unfortunately there is another more complex
patch in limbo that improves performance by a additional 10%. It is
Nikita's dont-rotate-active-list.
The reason for the improvement is that it improves ordering of mapped
pages on the active list. Now I I'd like to fix this problem and get
this 10%. However dont-rotate-active-list is pretty ugly to put it
nicely.
OK, the theory is that mapped pagecache pages are worth more than
unmapped pages. This is a good theory because mapped pages will
usually have far more random access patterns, so pagein *and* pageout
will be much less efficient. Also, applications are probably coded to
be more suited to blocking in read() than a random code / anon memory
page. So a factor of >= 16 wouldn't be out of the question.
Now the basic problem is that we have these two classes of pages on
one (the active) list, and we attempt to place different scanning
semantics on each class. This is done with the reclaim_mapped logic.
Now I won't be too disparaging of reclaim_mapped because I think
Andrew crea^W^W^W^W it somehow more or less works, but it has a couple
of problems.
* Difficult to trace: relies on some saved state from earlier in time.
* difficult to control: relies on inner workings (eg "priority").
mapped vs unmapped scanning behaviour is derived basically by black
magic.
* not-quite-right semantics: mapped pages are infinitely preferable
to unmapped pages until something goes click and then they are worth
about half as much.
* These semantics mean that in low memory pressure (before the click),
truely inactive mapped pages will never be reclaimed. Probably they
should be to increase resident working set.
* Also, a significant number of mapped pages can be passed over
without doing any real work.
* This causes list position information to be lost (which is where
that 10% comes from).
Now I have an alternative which hopefully solves all these problems
and with less complexity than dont-rotate-active-list which only
solves the last one: split the active list into active_mapped and
active_unmapped lists. Pages are moved between them lazily at scan
time, and they needn't be totally accurate.
You then simply put 16 (or whatever) times the amount of pressure on
the unmapped list as you do on the mapped list. This number can be the
tunable (instead of swapiness).
I have an implementation which compiles, boots, and survives a -j8
kbuild. Probably still has a few problems though. Couple of things: it
presently just puts even pressure on both lists, so it is swappy
(trivial to fix). It also gives unmapped pages the full two level
(active+inactive) system because it was just easier to do it that way.
Don't know if this would be good or bad.
The patches go like this:
1/4: vm-lrutopage-cleanup
Cleanup from Nikita's dont-rotate-active-list patch.
2/4: vm-nofixed-active-list
Generalise active list scanning to scan different lists.
3/4: vm-no-reclaim_mapped
Kill reclaim_mapped and its merry men.
4/4: vm-mapped-x-active-lists
Split the active list into mapped and unmapped pages.
--
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:"aart@kvack.org"> aart@kvack.org </a>
next reply other threads:[~2004-03-09 5:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-09 5:32 Nick Piggin [this message]
2004-03-09 5:33 ` [RFC][PATCH 1/4] vm-lrutopage-cleanup Nick Piggin
2004-03-09 5:33 ` [RFC][PATCH 2/4] vm-nofixed-active-list Nick Piggin
2004-03-09 5:34 ` [RFC][PATCH 3/4] vm-no-reclaim_mapped Nick Piggin
2004-03-09 5:35 ` [RFC][PATCH 4/4] vm-mapped-x-active-lists Nick Piggin
2004-03-09 5:39 ` Nick Piggin
2004-03-09 5:47 ` Mike Fedyk
2004-03-09 6:06 ` Nick Piggin
2004-03-09 7:02 ` William Lee Irwin III
2004-03-09 7:23 ` Nick Piggin
2004-03-09 7:37 ` William Lee Irwin III
2004-03-09 9:24 ` William Lee Irwin III
2004-03-09 15:26 ` Marc-Christian Petersen
2004-03-09 15:42 ` Nikita Danilov
2004-03-10 2:49 ` Nick Piggin
2004-03-10 5:10 ` [RFC][PATCH 0/4] VM split active lists Nick Piggin
2004-03-12 9:58 ` Hans Reiser
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=404D56D8.2000008@cyberone.com.au \
--to=piggin@cyberone.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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