Re: Memory pressure handling with iSCSI
From: Martin J. Bligh
Date: Tue Jul 26 2005 - 20:21:51 EST
> It happens here, a bit. My machine goes up to 60% dirty when it should be
> clamping at 40%.
>
> The variable `total_pages' in page-writeback.c (from
> nr_free_pagecache_pages()) is too high. I trace it back to here:
>
> On node 0 totalpages: 1572864
> DMA zone: 4096 pages, LIFO batch:1
> Normal zone: 1568768 pages, LIFO batch:31
> HighMem zone: 0 pages, LIFO batch:1
>
> This machine only has 4G of memory, so the platform code is overestimating
> the number of pages by 50%. Can you please check your dmesg, see if your
> system is also getting this wrong?
I think we're repeatedly iterating over the same zones by walking the
zonelists:
static unsigned int nr_free_zone_pages(int offset)
{
pg_data_t *pgdat;
unsigned int sum = 0;
int i;
for_each_pgdat(pgdat) {
struct zone *zone;
for (i = 0; i < MAX_NR_ZONES; i++) {
unsigned long size, high;
zone = pgdat->node_zones[i];
size = zone->present_pages;
high = zone->pages_high;
if (size > high)
sum += size - high;
}
}
}
Does that look more sensible? I'd send you a real patch, except the
box just crashed ;-)
M.
-
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/