Re: Mem issues in 2.6.9 (ever since 2.6.9-rc3) and possible cause

Rik van Riel
2004-10-25T22:03:59Z

On Sat, 23 Oct 2004, Javier Marcet wrote:

> I'm not saying everything within the patch is needed, not even that it's
> the right thing to change.

I suspect the following (still untested) patch might be
needed, too. Basically when the VM gets tight, it could
still ignore swappable pages with the referenced bit set.
Both really referenced pages and pages from the process
that currently has the swap token.

Forcefully deactivating a few pages when we run with
priority 0 might get rid of the false OOM kills.

I'm about to test this on a very small system here, and
will let you know how things go.

===== mm/vmscan.c 1.231 vs edited =====
--- 1.231/mm/vmscan.c Sun Oct 17 01:07:24 2004
+++ edited/mm/vmscan.c Mon Oct 25 17:38:56 2004
@@ -379,7 +379,7 @@

referenced = page_referenced(page, 1);
/* In active use or really unfreeable? Activate it. */
- if (referenced && page_mapping_inuse(page))
+ if (referenced && sc->priority && page_mapping_inuse(page))
goto activate_locked;

#ifdef CONFIG_SWAP
@@ -715,7 +715,7 @@
if (page_mapped(page)) {
if (!reclaim_mapped ||
(total_swap_pages == 0 && PageAnon(page)) ||
- page_referenced(page, 0)) {
+ (page_referenced(page, 0) && sc->priority)) {
list_add(&page->lru, &l_active);
continue;
}