From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C333C433F5 for ; Thu, 7 Apr 2022 09:44:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB6858D0001; Thu, 7 Apr 2022 05:44:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C65C36B0075; Thu, 7 Apr 2022 05:44:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B06558D0001; Thu, 7 Apr 2022 05:44:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id A1C136B0074 for ; Thu, 7 Apr 2022 05:44:29 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 68F4DACF50 for ; Thu, 7 Apr 2022 09:44:19 +0000 (UTC) X-FDA: 79329597438.28.494B151 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf02.hostedemail.com (Postfix) with ESMTP id C9D9580008 for ; Thu, 7 Apr 2022 09:44:18 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id B19DC1F859; Thu, 7 Apr 2022 09:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649324657; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tNtnnv47l8kZs+TIL27Yd98JmTykdLmyWqvUcwUs4bc=; b=YvvqO5eCoJkTrKNvr0LemmEccjLFQD1q52bnbwoUP3Mp3BSM0wXsKR1i2bKn+G/Lp/LxJE UVUxyUL2mSlYBW0+xJmnPTkHgfVj2gOmG99QBtG6XoZNM1xnBiBLjkHX6XmcHZBavCuIiO 6FU6nqP6u4FkABX4cukU832lSUGRxPY= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 62F8BA3B87; Thu, 7 Apr 2022 09:44:15 +0000 (UTC) Date: Thu, 7 Apr 2022 11:44:11 +0200 From: Michal Hocko To: Zhaoyang Huang Cc: Suren Baghdasaryan , "zhaoyang.huang" , Andrew Morton , Johannes Weiner , Vladimir Davydov , "open list:MEMORY MANAGEMENT" , LKML , cgroups mailinglist , Ke Wang Subject: Re: [RFC PATCH] cgroup: introduce dynamic protection for memcg Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C9D9580008 X-Stat-Signature: rdh5tk8nkdjpq945uxgj8ys6maidm1zj Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=YvvqO5eC; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf02.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspam-User: X-HE-Tag: 1649324658-847691 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: [...] On Thu 07-04-22 16:59:50, Zhaoyang Huang wrote: > > This means that limits are altered even if there is memory to be > > reclaimed from other memcgs. Why? How does this line up with the > > basic property of the low limit to act as a protection from the reclaim? > ok, partially understand. I would like to say that low's original > definition under this patch has changed, says the calculated low just > provide protection when the psi value is lower than the setting and > will introduce reclaiming if it exceed. OK, I guess I finally get to understand what you are trying to say. So effectivelly your new semantic defines the low limit as an initial protection that is very soft and only preserved under a light global memory pressure[1]. If the reclaim pressure is higher the user provided protection is decreased. The new semantic is planned to be a global opt-in. Correct? Now, that I (believe) to have a slightly better understanding I have to say I really dislike the idea. First of all the new semantic would have to be memcg reclaim aware. That means that the scaling logic would need to be aware where the memory pressure comes from. More importantnly I really dislike the idea that the user provided input is updated by the kernel without userspace knowledge about that. How is the userspace supposed to know that the value has been changed? I can see how the effective values could be scaled down but this still sounds dubious as the userspace would have hard time to understand what is going on under the cover or even worse tune the value based on the specific observed behavior for a specific kernel which would make this a maintenance burden going forward. All that being said I have hard time to make sense of a protection which is unpredictably decreasing based on a global metrics without any userspace view into why and how this is done. So I am afraid I have to NACK this and I really do recommend you to start a discussion about your specific usecase and try to find a different solution. Best regards [1] this is based on the global PSI metric. -- Michal Hocko SUSE Labs