Re: [PATCH 0/4] Memory controller soft limit patches (v3)

From: KAMEZAWA Hiroyuki
Date: Thu Mar 05 2009 - 04:15:19 EST



I wrote almost all concerns are addressed but following part is a concern.

On Thu, 5 Mar 2009 18:04:10 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:

> @@ -1758,6 +1778,7 @@ static unsigned long balance_pgdat(pg_da
> {
> int all_zones_ok;
> int priority;
> + int nid = pgdat->node_id;
> int i;
> unsigned long total_scanned;
> struct reclaim_state *reclaim_state = current->reclaim_state;
> @@ -1785,6 +1806,8 @@ loop_again:
> for (i = 0; i < pgdat->nr_zones; i++)
> temp_priority[i] = DEF_PRIORITY;
>
> + mem_cgroup_update_softlimit_hint(nid);
> +
> for (priority = DEF_PRIORITY; priority >= 0; priority--) {
> int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */
> unsigned long lru_pages = 0;
> @@ -1863,8 +1886,17 @@ loop_again:
> * zone has way too many pages free already.
> */
> if (!zone_watermark_ok(zone, order, 8*zone->pages_high,
> - end_zone, 0))
> - shrink_zone(priority, zone, &sc);
> + end_zone, 0)) {
> + /*
> + * If priority is not so bad, try softlimit
> + * of memcg.
> + */
> + if (!(priority < DEF_PRIORITY - 2))
> + softlimit_shrink_zone(nid, i,
> + priority, zone, &sc);
> + else
> + shrink_zone(priority, zone, &sc);
> + }
> reclaim_state->reclaimed_slab = 0;
> nr_slab = shrink_slab(sc.nr_scanned, GFP_KERNEL,
> lru_pages);

This may increase priority to unexpected level, So, insert softlimit_shrink_zone()
before diving into this priority loop of balance_pgdat() may be better.

Thanks,
-Kame



--
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/