public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chip Salzenberg <chip@valinux.com>
To: Rik van Riel <riel@conectiva.com.br>
Cc: Ville Herva <vherva@mail.niksula.cs.hut.fi>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] blindingly stupid 2.2 VM bug
Date: Fri, 24 Nov 2000 15:28:31 -0800	[thread overview]
Message-ID: <20001124152831.A5696@valinux.com> (raw)
In-Reply-To: <20001119100100.A54301@niksula.cs.hut.fi> <Pine.LNX.4.21.0011201135590.4587-100000@duckman.distro.conectiva>
In-Reply-To: <Pine.LNX.4.21.0011201135590.4587-100000@duckman.distro.conectiva>; from riel@conectiva.com.br on Mon, Nov 20, 2000 at 11:38:38AM -0200

According to Rik van Riel:
> Luckily my patch fixes some of the suspect areas in
> VM-global [...]

Would you say that the below patch is just the try_to_free_pages
bug fix, then?

Index: mm/vmscan.c
--- mm/vmscan.c.prev
+++ mm/vmscan.c	Fri Nov 24 15:17:59 2000
@@ -401,4 +401,5 @@ int try_to_free_pages(unsigned int gfp_m
 	int priority;
 	int count = SWAP_CLUSTER_MAX;
+	int loopcount = count;
 	int killed = 0;
 
@@ -409,5 +410,5 @@ int try_to_free_pages(unsigned int gfp_m
 
 again:
-	priority = 5;
+	priority = 6;
 	do {
 		while (shrink_mmap(priority, gfp_mask)) {
@@ -431,5 +432,10 @@ again:
 
 		shrink_dcache_memory(priority, gfp_mask);
-	} while (--priority > 0);
+
+		/* Only lower priority if we didn't make progress. */
+		if (count == loopcount)
+			--priority;
+		loopcount = count;
+	} while (priority > 0);
 done:
 	unlock_kernel();
@@ -454,6 +460,9 @@ done:
 	}
 
-	/* Return success if we freed a page. */
-	return priority > 0;
+	/* Return success if we have enough free memory or we freed a page. */
+	if (nr_free_pages > freepages.low)
+		return 1;
+
+	return count < SWAP_CLUSTER_MAX;
 }
 

-- 
Chip Salzenberg            - a.k.a. -            <chip@valinux.com>
   "Give me immortality, or give me death!"  // Firesign Theatre
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-11-25  0:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-19  0:04 [PATCH] blindingly stupid 2.2 VM bug Rik van Riel
2000-11-19  8:01 ` Ville Herva
2000-11-20 13:38   ` Rik van Riel
2000-11-24 23:28     ` Chip Salzenberg [this message]
2000-11-25 13:57       ` Andrea Arcangeli
2000-11-25 17:06         ` Rik van Riel
2000-11-28 23:02         ` John Kennedy
2000-11-28 23:20           ` Andrea Arcangeli
2000-11-28 23:36             ` John Kennedy
2000-11-29  0:04               ` Andrea Arcangeli
2000-11-29  0:35                 ` John Kennedy
2000-11-30 11:47                   ` Stephen C. Tweedie

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=20001124152831.A5696@valinux.com \
    --to=chip@valinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@conectiva.com.br \
    --cc=vherva@mail.niksula.cs.hut.fi \
    /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