[PATCH 3/5] mm improvements

Nick Piggin
2004-02-04T09:41:25Z

[-- Attachment #1: Type: text/plain, Size: 190 bytes --]

Nick Piggin wrote:

> 3/5: vm-lru-info.patch
> Keep more referenced info in the active list. Should also improve
> system time in some cases. Helps swapping loads significantly.
>

[-- Attachment #2: vm-lru-info.patch --]
[-- Type: text/plain, Size: 1385 bytes --]

When refill_inactive_list is running !reclaim_mapped, it clears a mapped
pages referenced bits then puts them back to the head of the active list.
Referenced and non referenced mapped pages are treated the same, so you
lose the "referenced" information.

This patch causes the referenced bits to not be cleared during !reclaim_mapped.

It improves heavy swapping performance significantly.

linux-2.6-npiggin/mm/vmscan.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)

diff -puN mm/vmscan.c~vm-lru-info mm/vmscan.c
--- linux-2.6/mm/vmscan.c~vm-lru-info 2004-02-04 14:09:45.000000000 +1100
+++ linux-2.6-npiggin/mm/vmscan.c 2004-02-04 14:09:45.000000000 +1100
@@ -711,6 +711,16 @@ refill_inactive_zone(struct zone *zone,
page = lru_to_page(&l_hold);
list_del(&page->lru);
if (page_mapped(page)) {
+
+ /*
+ * Don't clear page referenced if we're not going
+ * to use it.
+ */
+ if (!reclaim_mapped) {
+ list_add(&page->lru, &l_ignore);
+ continue;
+ }
+
/*
* probably it would be useful to transfer dirty bit
* from pte to the @page here.
@@ -722,10 +732,6 @@ refill_inactive_zone(struct zone *zone,
continue;
}
pte_chain_unlock(page);
- if (!reclaim_mapped) {
- list_add(&page->lru, &l_ignore);
- continue;
- }
}
/*
* FIXME: need to consider page_count(page) here if/when we

_