Received: by 10.213.65.68 with SMTP id h4csp3268237imn; Tue, 3 Apr 2018 01:41:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx48NKsLdarAfDvYx1naCGtLohATkErCwwfCUJIcKWEh/8CV9jCBki3iYHJ2qm7PMEbpBvTwu X-Received: by 2002:a17:902:bd91:: with SMTP id q17-v6mr11379229pls.330.1522744906603; Tue, 03 Apr 2018 01:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522744906; cv=none; d=google.com; s=arc-20160816; b=wmsCGsms1tRNfbHZHSEJi097reX+LAdTKr1nrbEpAIWZpaTr/2Qubavo/3p3/3Ntbq SD7zzGREjG2DdcvNKqT+JkptRBfGPpulAeH0y6aOCY4ZyJErjju1akqIZuWnFl5b3kZs HayuCS6B8YUAD732/h4/XS2OgkhHB8rlMITorBcLWoEnECXkqN2cGNDrUBwStWW2PTbc cibP7g9emwa2cmevsopBMfzZUvWDIZHShvqCXTkSkzUpAR5iLYyqRQALD6KyR1XalrGU xgMDuMUNv5pYxbKbjlOGooosDuMWwKjcwymP81k8ZfvekPfkbnJ4FgOQUrwREotrG3NJ bXAA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=N0onwLb/UFcmPp7C7DGCJrZTuS8vUiwkvVBSHAxBfpM=; b=YUAMzTex7Js0ai3H0HOcZqJ5x26fGAfYxDgNILOrNoEoUiN4V7rhmz/vgYdP9zeqwe Ad2CnwTnL/FEXuLzkCuH952IQYlpSuva5PSWF6yKspeaHJb9JtqhJfshLjYjOv2gk2aS 1Ob7JnikEfMCZUHJPHMIJBM2Gel4vDatgUmo2ddL9iVQbxyZCSH1FgTxzeIn0g3hnEG/ SXK4J2tDu3n92/XkD3I574WEGJ6WePDS8jmEL2dMco60+rgiWuKCGHJawhVBt7/gPE0M PgG2OdOilXdhhPzoJItJMU0b3UUOkrwFGjIVEMZHKEaQPwnyFbLSU+ufWd6QeTxo6f1O gfaQ== 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 b11-v6si13212plk.688.2018.04.03.01.41.32; Tue, 03 Apr 2018 01:41:46 -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 S1755170AbeDCIk2 (ORCPT + 99 others); Tue, 3 Apr 2018 04:40:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:32998 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754965AbeDCIk1 (ORCPT ); Tue, 3 Apr 2018 04:40:27 -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 C6989AD5E; Tue, 3 Apr 2018 08:40:25 +0000 (UTC) Date: Tue, 3 Apr 2018 10:40:24 +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: <20180403084024.GH5501@dhcp22.suse.cz> References: <2AD939572F25A448A3AE3CAEA61328C23756E4F1@BC-MAIL-M28.internal.baidu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2AD939572F25A448A3AE3CAEA61328C23756E4F1@BC-MAIL-M28.internal.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 08:29:39, Li,Rongqing wrote: > > > > -----邮件原件----- > > 发件人: Michal Hocko [mailto:mhocko@kernel.org] > > 发送时间: 2018年4月3日 16:05 > > 收件人: Li,Rongqing > > 抄送: hannes@cmpxchg.org; vdavydov.dev@gmail.com; > > cgroups@vger.kernel.org; linux-mm@kvack.org; > > linux-kernel@vger.kernel.org > > 主题: Re: [PATCH] mm: avoid the unnecessary waiting when force empty a > > cgroup > > > > 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. > > If a process in a memory cgroup takes some RSS, when force empty this > memory cgroup, congestion_wait will be called unconditionally, there > is 0.5 seconds delay OK, so the problem is that force_empty hits congestion_wait too much? Why do we have no progress from try_to_free_mem_cgroup_pages? > If use this patch, nearly no delay. > > > > Why do wee another throttling when we do already throttle in the reclaim > > path? > > Do you mean we should remove congestion_wait(BLK_RW_ASYNC, HZ/10) > from mem_cgroup_force_empty, since try_to_free_mem_cgroup_pages > [shrink_inactive_list] has called congestion_wait If it turns unnecessary, which is quite possible then yes. As I've said we already throttle when seeing pages under writeback. If that is not sufficient then we should investigate why. Please also note that force_empty is considered deprecated. Do you have any usecase which led you to fixing it? -- Michal Hocko SUSE Labs