From: "M.H.VanLeeuwen" <vanl@megsinet.net>
To: vda@port.imtp.ilyichevsk.odessa.ua
Cc: Marcelo Tosatti <marcelo@conectiva.com.br>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] - Taming OOM killer, 2.4.17-rc1
Date: Fri, 11 Jan 2002 18:22:32 -0600 [thread overview]
Message-ID: <3C3F81C8.9744C16A@megsinet.net> (raw)
In-Reply-To: <20011212094246.O4801@athlon.random> <3C1AB4B4.A24A0A5@megsinet.net> <200201112113.g0BLDFE24964@Port.imtp.ilyichevsk.odessa.ua>
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
Denis,
This patch was a feeble attempt at fixing a real VM problem by masking what was
really going on.
There are many "better" solution than this old patch
AA has a great VM patch
Rik has an rmap patch that looks promising
and my latest "simple" fix is attached for 2.4.17 but should apply to 2.4.18-pre
Thanks for looking at this old one though.
Martin
BTW: w/ this patch you no longer need to Tame the OOM killer
[-- Attachment #2: vmscan.patch.2.4.17.d --]
[-- Type: application/octet-stream, Size: 1325 bytes --]
--- linux.virgin/mm/vmscan.c Mon Dec 31 12:46:25 2001
+++ linux/mm/vmscan.c Fri Jan 11 18:03:05 2002
@@ -394,9 +394,9 @@
if (PageDirty(page) && is_page_cache_freeable(page) && page->mapping) {
/*
* It is not critical here to write it only if
- * the page is unmapped beause any direct writer
+ * the page is unmapped because any direct writer
* like O_DIRECT would set the PG_dirty bitflag
- * on the phisical page after having successfully
+ * on the physical page after having successfully
* pinned it and after the I/O to the page is finished,
* so the direct writes to the page cannot get lost.
*/
@@ -480,11 +480,14 @@
/*
* Alert! We've found too many mapped pages on the
- * inactive list, so we start swapping out now!
+ * inactive list.
+ * Move referenced pages to the active list.
*/
- spin_unlock(&pagemap_lru_lock);
- swap_out(priority, gfp_mask, classzone);
- return nr_pages;
+ if (PageReferenced(page) && !PageLocked(page)) {
+ del_page_from_inactive_list(page);
+ add_page_to_active_list(page);
+ }
+ continue;
}
/*
@@ -521,6 +524,9 @@
}
spin_unlock(&pagemap_lru_lock);
+ if (max_mapped <= 0 && (nr_pages > 0 || priority < DEF_PRIORITY))
+ swap_out(priority, gfp_mask, classzone);
+
return nr_pages;
}
prev parent reply other threads:[~2002-01-12 0:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20011212094246.O4801@athlon.random>
2001-12-15 2:25 ` [PATCH] - Taming OOM killer, 2.4.17-rc1 M.H.VanLeeuwen
2002-01-12 1:13 ` Denis Vlasenko
2002-01-12 0:22 ` M.H.VanLeeuwen [this message]
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=3C3F81C8.9744C16A@megsinet.net \
--to=vanl@megsinet.net \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=vda@port.imtp.ilyichevsk.odessa.ua \
/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