false NUMA OOM

William Lee Irwin III (wli@holomorphy.com)
Mon, 16 Sep 2002 19:50:35 -0700


Well, there's an obvious problem. shrink_caches() hammers out_of_memory()
when it has only looked at a single node. Something like this might help.

Totally untested. Problem discovered during 2 simultaneous dbench 512's
on separate 12GB tmpfs fs's on a 32x NUMA-Q with 32GB of RAM.

Against 2.5.35.

Bill

--- mm/vmscan.c.orig 2002-09-16 19:02:11.000000000 -0700
+++ mm/vmscan.c 2002-09-16 19:07:50.000000000 -0700
@@ -519,18 +519,24 @@
shrink_caches(struct zone *classzone, int priority,
int gfp_mask, int nr_pages)
{
+ pg_data_t *pgdat;
struct zone *first_classzone;
struct zone *zone;
+ int type;

first_classzone = classzone->zone_pgdat->node_zones;
- zone = classzone;
- while (zone >= first_classzone && nr_pages > 0) {
- if (zone->free_pages <= zone->pages_high) {
- nr_pages = shrink_zone(zone, priority,
- gfp_mask, nr_pages);
+ for (type = classzone - first_classzone; type >= 0; --type)
+ for_each_pgdat(pgdat) {
+ zone = pgdat->node_zones + type;
+ if (!zone->size)
+ continue;
+ if (zone->free_pages <= zone->pages_high)
+ nr_pages = shrink_zone(zone, priority,
+ gfp_mask, nr_pages);
+ if (nr_pages <= 0)
+ return nr_pages;
}
- zone--;
- }
+
return nr_pages;
}

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