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 A4A4FC433EF for ; Thu, 7 Apr 2022 14:15:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B5CB66B0072; Thu, 7 Apr 2022 10:15:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE49E6B0073; Thu, 7 Apr 2022 10:15:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95E1D6B0074; Thu, 7 Apr 2022 10:15:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 8378A6B0072 for ; Thu, 7 Apr 2022 10:15:11 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2ED8F8249980 for ; Thu, 7 Apr 2022 14:15:01 +0000 (UTC) X-FDA: 79330279602.22.703A277 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf21.hostedemail.com (Postfix) with ESMTP id 81A231C0007 for ; Thu, 7 Apr 2022 14:15:00 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0EEFE1F85E; Thu, 7 Apr 2022 14:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649340899; 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=dKwrr1idTmWArX2lqn5YORjBOhR4BKEAOp87gdFGmAs=; b=JJOWpMh04HvpMRV9OHslNnYorECxh2BD2x5KOqtVFuXhlvMJYVYdpOespQ8gzdXuS+vIbr xcez1y5fivmjExddn6mXf7iZ7mev5ZvAdim89+c+9N8W2INFFncr1rhx9538zF0O2NhH+2 neOak+Z7R28zFIrQW/wC8IqrTMRVydg= 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 75EEAA3B87; Thu, 7 Apr 2022 14:14:58 +0000 (UTC) Date: Thu, 7 Apr 2022 16:14:57 +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: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=JJOWpMh0; spf=pass (imf21.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 81A231C0007 X-Stat-Signature: as75xx7eu7mwd74pcp81umzecesx879g X-HE-Tag: 1649340900-641366 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 20:36:51, Zhaoyang Huang wrote: > On Thu, Apr 7, 2022 at 5:44 PM Michal Hocko wrote: > > > > [...] > > 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? > right. But I don't think the original protection is soft which could > be proved by the test result that the memcg is protected in a certain > range of pressure and could also help to release the system by > breaking low limit. Low limit protection is considered soft because it doesn't provide any guarantee. I will be ignored (and that will be reported to the userspace via LOW event) if there is nothing reclaimable in the scope of the reclaimed hierarchy. An alternative would be OOM actually. > > 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. > I don't follow. Does it mean that the protected should distinguish the > pressure from global and other memcgs? I don't know why. No, it should behave consistently for any external memory pressure. A reclaimed memcg can apply different constraint depending on the root of the reclaim. Your solution is considering root to be root_memcg. [...] -- Michal Hocko SUSE Labs