Received: by 10.213.65.68 with SMTP id h4csp3243042imn; Tue, 3 Apr 2018 01:06:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx480FNjreAX2X+IIouPHmt2qK/yiM3SD/oxt3Dv4EdLnZPXiAM1mPPbW2wBPSiCYggGcR/Nf X-Received: by 10.99.175.6 with SMTP id w6mr8208202pge.186.1522742792765; Tue, 03 Apr 2018 01:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522742792; cv=none; d=google.com; s=arc-20160816; b=mx2LnksRIy2yFSzLCTUXAAKIcjmCBZ6cz6N/6X1NPpwmguFLpyfgpuihw27oHAu/QY Pn5bWPutEe94RgT/t6Fhtru1t6b9sRvYypOgCRF8cLmvFPUpXBXYCHlwV3DIvyH56tSa F5thuOU+ywqJBIZYjwYRyv76a54K5/g5MkaCqQRE8ZIsHK2RyDpZENDW1yGUR2roH6FK QihhIaqNcymOEb/bxzCLjkD5dZ4/LjvoCUgDuQxXkRAZpB6WlNACYXNCzerIEA/tLmnA IZm639SGP8i4/O9KGw8UrWCfmmDK457vqHr5los0ck8KmafOv/FfqfTLW8GAvcXyS3Fa 7cLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=6Q/hcFspmjT6JmjD6SamrN2tR15fsPea7d85LDDh2zs=; b=xNzAM0rimNhFnoAXiCirrTN3M9l+nGQcNDoplaJd1JNGRGKbOHGdQLoN15MpmgGn5B UtAeK96GC4BrpRRx00vfknlrpDxbjJi+h/KI9AsVYA8edZTTuCcn/TASSw2UW9ARooPc yGwLBr/sTfRpfJb+NyWnTE6LV9gk+lof7rw6lgA7EFnFRHUEmKOaKmzyWFrmHyucsiry ySMs/foF92+f/iKhIbcDWizLXeWf90vJo9knZHOnQXQe6YCyX512vtde/32WwzeekEUc LMMA4/wAaFdjUng4TXEUw5esw7+ajhdGZxVptLOJtcu33fLVk7bFYldeTr49x9kjW8uf mESg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si1746641pfj.320.2018.04.03.01.06.18; Tue, 03 Apr 2018 01:06:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754936AbeDCIFH (ORCPT + 99 others); Tue, 3 Apr 2018 04:05:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:55864 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752581AbeDCIFG (ORCPT ); Tue, 3 Apr 2018 04:05:06 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8F0BEAD3C; Tue, 3 Apr 2018 08:05:04 +0000 (UTC) Date: Tue, 3 Apr 2018 10:05:03 +0200 From: Michal Hocko To: Li RongQing Cc: hannes@cmpxchg.org, vdavydov.dev@gmail.com, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: avoid the unnecessary waiting when force empty a cgroup Message-ID: <20180403080503.GE5501@dhcp22.suse.cz> References: <1522739529-5602-1-git-send-email-lirongqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522739529-5602-1-git-send-email-lirongqing@baidu.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 03-04-18 15:12:09, Li RongQing wrote: > The number of writeback and dirty page can be read out from memcg, > the unnecessary waiting can be avoided by these counts This changelog doesn't explain the problem and how the patch fixes it. Why do wee another throttling when we do already throttle in the reclaim path? > Signed-off-by: Li RongQing > --- > mm/memcontrol.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 9ec024b862ac..5258651bd4ec 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -2613,9 +2613,13 @@ static int mem_cgroup_force_empty(struct mem_cgroup *memcg) > progress = try_to_free_mem_cgroup_pages(memcg, 1, > GFP_KERNEL, true); > if (!progress) { > + unsigned long num; > + > + num = memcg_page_state(memcg, NR_WRITEBACK) + > + memcg_page_state(memcg, NR_FILE_DIRTY); > nr_retries--; > - /* maybe some writeback is necessary */ > - congestion_wait(BLK_RW_ASYNC, HZ/10); > + if (num) > + congestion_wait(BLK_RW_ASYNC, HZ/10); > } > > } > -- > 2.11.0 -- Michal Hocko SUSE Labs