Re: [RFC 2/3] mm: throttle on IO only when there are too many dirty and writeback pages

From: Michal Hocko
Date: Fri Oct 30 2015 - 04:38:17 EST


On Fri 30-10-15 14:48:40, KAMEZAWA Hiroyuki wrote:
[...]
> > @@ -3191,8 +3191,23 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
> > */
> > if (__zone_watermark_ok(zone, order, min_wmark_pages(zone),
> > ac->high_zoneidx, alloc_flags, target)) {
> > - /* Wait for some write requests to complete then retry */
> > - wait_iff_congested(zone, BLK_RW_ASYNC, HZ/50);
> > + unsigned long writeback = zone_page_state(zone, NR_WRITEBACK),
> > + dirty = zone_page_state(zone, NR_FILE_DIRTY);
> > +
> > + if (did_some_progress)
> > + goto retry;
> > +
> > + /*
> > + * If we didn't make any progress and have a lot of
> > + * dirty + writeback pages then we should wait for
> > + * an IO to complete to slow down the reclaim and
> > + * prevent from pre mature OOM
> > + */
> > + if (2*(writeback + dirty) > reclaimable)
>
> Doesn't this add unnecessary latency if other zones have enough clean memory ?

We know we haven't made any progress the last reclaim round so any zone
with a clean memory is rather unlikely.

--
Michal Hocko
SUSE Labs
--
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/