public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Pavel Machek <pavel@suse.cz>
Cc: ncunningham@linuxmail.org, cef-lkml@optusnet.com.au,
	linux-kernel@vger.kernel.org, rob@landley.net, seife@suse.de
Subject: Re: swappiness=0 makes software suspend fail.
Date: Mon, 31 May 2004 03:09:14 -0700	[thread overview]
Message-ID: <20040531030914.0e20d2e0.akpm@osdl.org> (raw)
In-Reply-To: <20040529222308.GA1535@elf.ucw.cz>

Pavel Machek <pavel@suse.cz> wrote:
>
> Right solution is to make sure that shrink_all_memory() works, no
>  matter how swappiness is set.

off-by-one in balance_pgdat() was the main problem.


--- 25/mm/vmscan.c~shrink_all_memory-fix	2004-05-31 03:04:05.669374824 -0700
+++ 25-akpm/mm/vmscan.c	2004-05-31 03:04:05.673374216 -0700
@@ -813,8 +813,7 @@ shrink_caches(struct zone **zones, int p
 		struct zone *zone = zones[i];
 		int max_scan;
 
-		if (zone->free_pages < zone->pages_high)
-			zone->temp_priority = priority;
+		zone->temp_priority = priority;
 
 		if (zone->all_unreclaimable && priority != DEF_PRIORITY)
 			continue;	/* Let kswapd poll it */
@@ -945,7 +944,7 @@ static int balance_pgdat(pg_data_t *pgda
 		zone->temp_priority = DEF_PRIORITY;
 	}
 
-	for (priority = DEF_PRIORITY; priority; priority--) {
+	for (priority = DEF_PRIORITY; priority >= 0; priority--) {
 		int all_zones_ok = 1;
 		int end_zone = 0;	/* Inclusive.  0 = ZONE_DMA */
 
@@ -995,6 +994,8 @@ scan:
 					all_zones_ok = 0;
 			}
 			zone->temp_priority = priority;
+			if (zone->prev_priority > priority)
+				zone->prev_priority = priority;
 			max_scan = (zone->nr_active + zone->nr_inactive)
 								>> priority;
 			reclaimed = shrink_zone(zone, max_scan, GFP_KERNEL,
_


  reply	other threads:[~2004-05-31 10:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-28  5:00 swappiness=0 makes software suspend fail Rob Landley
2004-05-28 21:56 ` Pavel Machek
2004-05-29  7:48   ` Nigel Cunningham
2004-05-29  9:05   ` Stuart Young
2004-05-29  8:56     ` Nigel Cunningham
2004-05-29 22:23       ` Pavel Machek
2004-05-31 10:09         ` Andrew Morton [this message]
2004-05-31 10:42           ` Nick Piggin
2004-05-31 10:17         ` Andrew Morton
2004-05-31 11:38           ` Rob Landley
2004-05-31 11:52             ` Pavel Machek
2004-06-01 10:46               ` Nigel Cunningham
2004-06-03 12:08                 ` Pavel Machek
2004-05-31 22:57             ` Flavio Stanchina
2004-06-04 12:20               ` Pavel Machek
2004-05-31 11:50           ` Pavel Machek
2004-05-31 19:07             ` Stefan Seyfried
2004-05-29 22:36       ` Pavel Machek
2004-05-30  2:21         ` Nick Piggin
2004-05-30 19:47           ` Pavel Machek
2004-05-30 23:23             ` Oliver Neukum
2004-05-31  3:28               ` Rob Landley
2004-05-31  6:18             ` Stuart Young
2004-05-31  8:41               ` Pavel Machek
2004-05-29 11:35     ` Pavel Machek

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=20040531030914.0e20d2e0.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=cef-lkml@optusnet.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncunningham@linuxmail.org \
    --cc=pavel@suse.cz \
    --cc=rob@landley.net \
    --cc=seife@suse.de \
    /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