All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Nick Piggin <piggin@cyberone.com.au>
Cc: Andrew Morton <akpm@osdl.org>,
	chrisw@osdl.org, linux-kernel@vger.kernel.org,
	davej@codemonkey.org.uk
Subject: Re: kswapd in tight loop 2.6.9-rc3-bk-recent
Date: Fri, 08 Oct 2004 14:48:48 +1000	[thread overview]
Message-ID: <41661C30.6070102@yahoo.com.au> (raw)
In-Reply-To: <41660F64.3090802@cyberone.com.au>

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

Nick Piggin wrote:

> 
> I think my patch would be sufficient to handle the kswapd side
> (yours would be valid too, but no need to add the extra checks).

Here is the combined patch with Andrew's hunk added.

I guess it doesn't _really_ matter which gets tested, but this
one is probably the preferred way to go because it doesn't even
wake up kswapd for empty zones. Andrew, do you agree?

I guess it should get into -bk pretty soon if it passes testing.
It is fairly easy to see the failure cases that are fixed (and
hopefully it doesn't domino yet another latent bug :P).

[-- Attachment #2: vm-fix-empty-zones.patch --]
[-- Type: text/x-patch, Size: 1445 bytes --]



Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>


---

 linux-2.6-npiggin/mm/vmscan.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff -puN mm/vmscan.c~vm-fix-empty-zones mm/vmscan.c
--- linux-2.6/mm/vmscan.c~vm-fix-empty-zones	2004-10-08 12:44:14.000000000 +1000
+++ linux-2.6-npiggin/mm/vmscan.c	2004-10-08 14:28:04.000000000 +1000
@@ -851,6 +851,9 @@ shrink_caches(struct zone **zones, struc
 	for (i = 0; zones[i] != NULL; i++) {
 		struct zone *zone = zones[i];
 
+		if (zone->present_pages == 0)
+			continue;
+
 		zone->temp_priority = sc->priority;
 		if (zone->prev_priority > sc->priority)
 			zone->prev_priority = sc->priority;
@@ -1003,7 +1006,7 @@ static int balance_pgdat(pg_data_t *pgda
 						priority != DEF_PRIORITY)
 					continue;
 
-				if (zone->free_pages <= zone->pages_high) {
+				if (zone->free_pages < zone->pages_high) {
 					end_zone = i;
 					goto scan;
 				}
@@ -1035,7 +1038,7 @@ scan:
 				continue;
 
 			if (nr_pages == 0) {	/* Not software suspend */
-				if (zone->free_pages <= zone->pages_high)
+				if (zone->free_pages < zone->pages_high)
 					all_zones_ok = 0;
 			}
 			zone->temp_priority = priority;
@@ -1142,7 +1145,7 @@ static int kswapd(void *p)
  */
 void wakeup_kswapd(struct zone *zone)
 {
-	if (zone->free_pages > zone->pages_low)
+	if (zone->free_pages >= zone->pages_low)
 		return;
 	if (!waitqueue_active(&zone->zone_pgdat->kswapd_wait))
 		return;

_

  reply	other threads:[~2004-10-08  4:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-07 21:20 kswapd in tight loop 2.6.9-rc3-bk-recent Chris Wright
2004-10-07 21:39 ` Dave Jones
2004-10-07 21:49   ` Chris Wright
2004-10-07 23:40 ` Andrew Morton
2004-10-08  0:34   ` Nick Piggin
2004-10-08  0:37     ` Andrew Morton
2004-10-08  0:51       ` Chris Wright
2004-10-08  1:40         ` Andrew Morton
2004-10-08  0:42     ` Andrew Morton
2004-10-08  1:41       ` Chris Wright
2004-10-08  1:51         ` Chris Wright
2004-10-08  1:53           ` Andrew Morton
2004-10-08  2:46             ` Nick Piggin
2004-10-08  3:01               ` Andrew Morton
2004-10-08  3:13                 ` Nick Piggin
2004-10-08  3:30                   ` Andrew Morton
2004-10-08  3:54                     ` Nick Piggin
2004-10-08  4:48                       ` Nick Piggin [this message]
2004-10-08  4:57                         ` Andrew Morton
2004-10-08  5:21                     ` Chris Wright
2004-10-08  5:27                       ` Chris Wright
2004-10-08 10:10                       ` Nick Piggin
2004-10-08  3:15                 ` Nick Piggin
2004-10-08  3:05             ` Chris Wright

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=41661C30.6070102@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=chrisw@osdl.org \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=piggin@cyberone.com.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.