Re: kswapd in tight loop 2.6.9-rc3-bk-recent

From: Andrew Morton
Date: Thu Oct 07 2004 - 22:38:42 EST


Nick Piggin <piggin@xxxxxxxxxxxxxxx> wrote:
>
> >> Ah, free_pages <= pages_high, ie. 0 <= 0, which is true;
> >> commence spinning.
> >>
> >
> >Maybe. It requires that the zonelists be screwy:
> >
> > Node 1 DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB
> > protections[]: 0 0 0
> > Node 1 Normal free:25272kB min:1020kB low:2040kB high:3060kB active:624172kB inactive:282700kB present:1047936kB
> > protections[]: 0 0 0
> > Node 1 HighMem free:0kB min:128kB low:256kB high:384kB active:0kB inactive:0kB present:0kB
> > protections[]: 0 0 0
> > Node 0 DMA free:728kB min:12kB low:24kB high:36kB active:788kB inactive:7848kB present:16384kB
> > protections[]: 0 0 0
> > Node 0 Normal free:27200kB min:1004kB low:2008kB high:3012kB active:332792kB inactive:422744kB present:1032188kB
> > protections[]: 0 0 0
> > Node 0 HighMem free:0kB min:128kB low:256kB high:384kB active:0kB inactive:0kB present:0kB
> > protections[]: 0 0 0
> >
> >See that DMA zone on node 1? Wonder how it got like that. It
> >should not be inside pgdat->nrzones anyway.
> >
> >
> Oh? Why not? I didn't think empty zones were filtered out?

That ininitialised zone should be outside pgdat->nr_zones, no?

> (perhaps they should be).

They will be.

Chris, do you have time to test this, against -linus?

diff -puN mm/vmscan.c~vmscan-handle-empty-zones mm/vmscan.c
--- 25/mm/vmscan.c~vmscan-handle-empty-zones 2004-10-07 19:10:52.844797784 -0700
+++ 25-akpm/mm/vmscan.c 2004-10-07 19:11:49.804138648 -0700
@@ -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;
@@ -999,6 +1002,9 @@ static int balance_pgdat(pg_data_t *pgda
for (i = pgdat->nr_zones - 1; i >= 0; i--) {
struct zone *zone = pgdat->node_zones + i;

+ if (zone->present_pages == 0)
+ continue;
+
if (zone->all_unreclaimable &&
priority != DEF_PRIORITY)
continue;
@@ -1033,6 +1039,9 @@ static int balance_pgdat(pg_data_t *pgda
for (i = 0; i <= end_zone; i++) {
struct zone *zone = pgdat->node_zones + i;

+ if (zone->present_pages == 0)
+ continue;
+
if (zone->all_unreclaimable && priority != DEF_PRIORITY)
continue;

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/