Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp703816ybb; Fri, 20 Mar 2020 06:46:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu6lgdZtLdZLTyRL1irQDdrhZcOXaLFt4w+xTM4wkzD1BOm/8mYCe/bnq8lOBSyXWyVUBA1 X-Received: by 2002:a05:6830:22eb:: with SMTP id t11mr7178187otc.9.1584712001967; Fri, 20 Mar 2020 06:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584712001; cv=none; d=google.com; s=arc-20160816; b=Dk10in7rWoeNEDsnQ5EWwfJ8S7MOWk87wPP9K+IatRGjojcw36MmlAEFZLyikOElhF xBEd1kHhEhlEbe9zBuJBRXAT3kAottOtrNYHFY3L1gYHuTw1nGRph9ZzLwrRZp1/08Ci fllrW8iAgS6Iii9BdrPeVDYw5pOKVwIcQWYVFSCJhIcBVK4mbcCvT5ZegG+BRuAzpoWd pfa5H7dkGPmfEKnQIkDQ9qUMpSZUqjPyUAfJj5LU3BU233noW/0aEwl/BgzENs0Wv/iu wUK0rUs/Q3QMmOmhGlQIfWMgoLRIeUANLdO3dokCKaofuNy1DQ5ZdHy0QciDtPMgeU9D ZFew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JoMCT/BRNQiPNC0aagaWJkcjnStn6MMheHBwrTllAYE=; b=oUxiEd7NVPkowHgENF6dxMSiYle5G08NhKmVtUE6Flou3D3bZ8Vi7JYUPeYygZbzzg BhQ0+2f0xgN1mfJVvSx8yDmw7sD++7j6/NB2UWWUpL7NKby1ay+7Da+ileL47eOIQ094 n1sf3GesI60GeboShYgiJXyTw1KSN8Wik9k6kzyw10LNHp++H1lsuMJc0ARFVLsXY/Pp QiAJXdjAMTKVJlLglNmkYvEQZeJIYBfEhAQE7HO2u4p0Kzicrb8XLEOWujH2R/xlMSBa PYOhpQx8W228UTPZ9eYGfF9dEMCnec2xNB4W4heVXGnGgfQYfDPMVPtl5vrW8osUBwPT LF1g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si2821744otb.284.2020.03.20.06.46.29; Fri, 20 Mar 2020 06:46:41 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727273AbgCTNod (ORCPT + 99 others); Fri, 20 Mar 2020 09:44:33 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36852 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726843AbgCTNod (ORCPT ); Fri, 20 Mar 2020 09:44:33 -0400 Received: by mail-wr1-f67.google.com with SMTP id 31so1534465wrs.3; Fri, 20 Mar 2020 06:44:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JoMCT/BRNQiPNC0aagaWJkcjnStn6MMheHBwrTllAYE=; b=PlUnHyS+XQ1zkv5WMm+aXYF7W7FzC81HX92HNNkkUW1HCS8GL9MTThfjoq90cMHCvV sjEdbBjITa5PigGXXCaFqMhvFvyUSvv2Pn/TYRLDzdTA1eCtXVrn+VV5U/54dJCsHmId c23VxxumlkR8rzrJQIBhL7AEE7QL2gfC7SOjsAbdJe1dIRZAjIjY1ReFbZaplUVJhuJ9 wac2o6cJ7E1zR3soErNRKhymEejgvmzSlw0HLezlpI3g3D1TLsGQ95TEsFna1cy0AH3X AZ1Vk7g5sOiocHEkVLxLR6LumB15QLkJO8z70Fuy8PvgVYtSAUlzOLoRtf7pesN/pVOY lX/Q== X-Gm-Message-State: ANhLgQ1m5WoX/GbiOYFg+MknCMjl0I2Ac6QKsJEjjce9W5ditOXQAbsn A/0g819CBbvlHNee3LMsRSs= X-Received: by 2002:adf:914e:: with SMTP id j72mr11378978wrj.109.1584711870045; Fri, 20 Mar 2020 06:44:30 -0700 (PDT) Received: from localhost (ip-37-188-140-107.eurotel.cz. [37.188.140.107]) by smtp.gmail.com with ESMTPSA id n63sm4850139wmf.6.2020.03.20.06.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2020 06:44:29 -0700 (PDT) Date: Fri, 20 Mar 2020 14:44:28 +0100 From: Michal Hocko To: Ivan Teterevkov Cc: "rientjes@google.com" , "willy@infradead.org" , "vbabka@suse.cz" , "tj@kernel.org" , "lizefan@huawei.com" , "hannes@cmpxchg.org" , "corbet@lwn.net" , "vdavydov.dev@gmail.com" , "akpm@linux-foundation.org" , "guro@fb.com" , "shakeelb@google.com" , "chris@chrisdown.name" , "yang.shi@linux.alibaba.com" , "tglx@linutronix.de" , "minchan@kernel.org" , "ying.huang@intel.com" , "ziqian.lzq@antfin.com" , "cgroups@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Jonathan Davies Subject: Re: [RFC] memcg: fix default behaviour of non-overridden memcg.swappiness Message-ID: <20200320134428.GG24409@dhcp22.suse.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 19-03-20 17:38:30, Ivan Teterevkov wrote: > This patch tries to resolve uncertainty around the memcg.swappiness when > it's not overridden by the user: shall there be the latest vm_swappiness > or the value captured at the moment when the cgroup was created? > > I'm sitting on the fence with regards to this patch because cgroup v1 is > considered legacy nowadays and the semantics of "swappiness" is already > overwhelmed. However, the patch might be considered as a "fix" because > looking at the documentation [1] one might have the impression that it's > the latest /proc/sys/vm/swappiness value that should be found in the > memcg.swappiness unless it's overridden or inherited from a cgroup where > it was overridden when the given cgroup was created. Could you be more specific what makes you think this? Let me quote the whole thing here : 5.3 swappiness : -------------- : : Overrides /proc/sys/vm/swappiness for the particular group. The tunable : in the root cgroup corresponds to the global swappiness setting. : : Please note that unlike during the global reclaim, limit reclaim : enforces that 0 swappiness really prevents from any swapping even if : there is a swap storage available. This might lead to memcg OOM killer : if there are no file pages to reclaim. I do not want to pick on words here but to me it sounds this tunable is clearly documented as the explicit override for the global value. The root memcg corresponds to the global limit because root tends to be special in many other aspects. But in general, the semantic of knobs is that they do not unexpectedly change their values without an explicit user/admin intervention. > > Also, shall this magic -1 be exposed to the user? I think it's a "no", > but what if the user wants to un-override the memcg.swappiness... If we are to use such a semantic then it absolutely has to be an opt-in behavior and expressed in some way to the user space (e.g. a symbolic name referring to the global setting). > > What do you reckon? I am not convinced we need it. There would have to be a real life usecase that cannot really work with the current semantic. I remember that this has been brought up when discussing early swappiness initialization [1]. But it seems there is a much better solution for that problem [2]. [1] http://lkml.kernel.org/r/BL0PR02MB560167492CA4094C91589930E9FC0@BL0PR02MB5601.namprd02.prod.outlook.com [2] http://lkml.kernel.org/r/20200317132105.24555-1-vbabka@suse.cz -- Michal Hocko SUSE Labs