linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ross Biro <rossb@google.com>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: linux-2.4.21 released
Date: Fri, 13 Jun 2003 12:24:16 -0700	[thread overview]
Message-ID: <3EEA24E0.7030801@google.com> (raw)
In-Reply-To: <20030613211405.16faa9f6.us15@os.inf.tu-dresden.de>

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

Here's a minor patch against 2.4.21 that should help reduce out of 
memory problems on high ram systems with no swap space.  It's only been 
minimally tested in 2.4.21, but I've been running something similiar on 
2.4.18 for a bit now.

    Ross



[-- Attachment #2: no-swap.patch --]
[-- Type: text/plain, Size: 1233 bytes --]

diff -urbBd linux-2.4.21/include/linux/swap.h linux-2.4.21-1/include/linux/swap.h
--- linux-2.4.21/include/linux/swap.h	Fri Jun 13 07:51:39 2003
+++ linux-2.4.21-1/include/linux/swap.h	Fri Jun 13 10:40:24 2003
@@ -82,6 +82,7 @@
 
 /* Swap 50% full? Release swapcache more aggressively.. */
 #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
+#define swap_avail() (nr_swap_pages > 0)
 
 extern unsigned int nr_free_pages(void);
 extern unsigned int nr_free_buffer_pages(void);
diff -urbBd linux-2.4.21/mm/vmscan.c linux-2.4.21-1/mm/vmscan.c
--- linux-2.4.21/mm/vmscan.c	Thu Nov 28 15:53:15 2002
+++ linux-2.4.21-1/mm/vmscan.c	Fri Jun 13 11:26:26 2003
@@ -474,6 +474,18 @@
 			spin_unlock(&pagecache_lock);
 			UnlockPage(page);
 page_mapped:
+                        /* if we don't have swap, it doesn't
+                           do much good to swap things out. */
+			if (!page->mapping && !swap_avail()) {
+				/* Let's make the page active since we
+				   cannot swap it out.  It gets it off
+				   the inactive list. */
+				spin_unlock(&pagemap_lru_lock);
+				activate_page(page);
+				ClearPageReferenced(page);
+				spin_lock(&pagemap_lru_lock);
+				continue;
+			}
 			if (--max_mapped >= 0)
 				continue;
 

  reply	other threads:[~2003-06-13 19:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-13 14:53 linux-2.4.21 released Marcelo Tosatti
2003-06-13 16:56 ` Stefan Foerster
2003-06-13 16:56   ` Damian Kolkowski
2003-06-13 17:37     ` Stephan von Krawczynski
2003-06-13 17:19       ` Damian Kołkowski
2003-06-13 17:49         ` Alan Cox
2003-06-13 17:45           ` Damian Kolkowski
2003-06-13 18:36           ` Damian Kołkowski
2003-06-13 21:04             ` Daniel Egger
2003-06-13 21:31               ` Damian Kołkowski
2003-06-15 14:29                 ` Daniel Egger
2003-06-14 15:59         ` Krzysiek Taraszka
2003-06-14 16:16           ` Damian Kołkowski
2003-06-13 18:10     ` Serguei Miridonov
2003-06-13 17:22   ` Matthias Andree
2003-06-13 17:29     ` Christoph Hellwig
2003-06-14 21:35       ` Diego Calleja García
2003-06-14 21:58         ` Ramón Rey Vicente󮠒
2003-06-15 12:02         ` Matthias Andree
2003-06-13 18:56     ` Ramón Rey Vicente󮠒ey Vicente
2003-06-13 20:03       ` Robert Love
2003-06-13 20:27         ` Ramón Rey Vicente󮠒
2003-06-13 21:50     ` J.A. Magallon
2003-06-14  7:31     ` Wiktor Wodecki
2003-06-13 19:14 ` Udo A. Steinberg
2003-06-13 19:24   ` Ross Biro [this message]
2003-06-14  2:02     ` Andrea Arcangeli
2003-06-14  4:28 ` Ben Collins
2003-06-14 15:36 ` CJ
2003-06-14 15:54   ` Jörn Engel
2003-06-14 16:29     ` CJ
2003-06-15 19:06       ` Jörn Engel
2003-06-15 19:49 ` linux-2.4.21 released , No changelog for sym53c8xx_2 mods ? Mr. James W. Laferriere
2003-06-16 22:22 ` linux-2.4.21 released Lukasz Trabinski
2003-06-13 16:40 Go Marcelo
2003-06-16  0:34 Fr�d�ric L. W. Meunier
2003-06-22 18:51 Fr�d�ric L. W. Meunier
2003-06-22 19:46 Nicolas Mailhot

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=3EEA24E0.7030801@google.com \
    --to=rossb@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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;
as well as URLs for NNTP newsgroup(s).