From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932803AbbJ3IhR (ORCPT ); Fri, 30 Oct 2015 04:37:17 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38853 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932300AbbJ3IhM (ORCPT ); Fri, 30 Oct 2015 04:37:12 -0400 Date: Fri, 30 Oct 2015 09:37:09 +0100 From: Michal Hocko To: Hillf Danton Cc: linux-mm@kvack.org, "'Andrew Morton'" , "'Linus Torvalds'" , "'Mel Gorman'" , "'Johannes Weiner'" , "'Rik van Riel'" , "'David Rientjes'" , "'Tetsuo Handa'" , "'LKML'" , Christoph Lameter Subject: Re: [RFC 2/3] mm: throttle on IO only when there are too many dirty and writeback pages Message-ID: <20151030083709.GD18429@dhcp22.suse.cz> References: <1446131835-3263-1-git-send-email-mhocko@kernel.org> <1446131835-3263-3-git-send-email-mhocko@kernel.org> <00f301d112ca$14db86c0$3e929440$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00f301d112ca$14db86c0$3e929440$@alibaba-inc.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 30-10-15 12:18:50, Hillf Danton wrote: > > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -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) > > + congestion_wait(BLK_RW_ASYNC, HZ/10); > > + else > > + cond_resched(); > > + > > Looks the vmstat updater issue is not addressed. This is not the aim of this patch set. -- Michal Hocko SUSE Labs