Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp39234pxh; Thu, 7 Apr 2022 13:17:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj7LnHl4S77zgyccGgeyxuov766k0esNHo+8N60N0sqgNQkO1w0e0tFlSZfg8VoyJgxDls X-Received: by 2002:a17:90b:350e:b0:1c6:cd4e:303a with SMTP id ls14-20020a17090b350e00b001c6cd4e303amr17536733pjb.141.1649362671943; Thu, 07 Apr 2022 13:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649362671; cv=none; d=google.com; s=arc-20160816; b=uhc1fN3DLRAFd1mrNPP/v+CI5+XJdlIf34kLJzsaxa9ssHIV0imRyb3kL83otvWKIp 13E6MneZ/NuYtYN0+I4zpgKqMYL/iC1cz68LIEfK1FE6ywd0N9Sagx/D6V81Jb5Pdg5+ 91Nwr/MlleiHHJhGvb1tSZcX2sqTRmrTVxYUmQgAZneQyBO8Ufu562c9alhNxPPVSX3w haQd9SQR6z2BauIJTzzKwVKYkRUd+EsM70ZTzHBRU0fIwRSpWdiLy+7dC3yxdYlV4HV1 B219aAohYxBtsAsUgGE69MauF5DWTqi3d4wKJGocKRvWbDVsSjWQSp/4Bl9nv9Ub6+0H 0isw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dKwrr1idTmWArX2lqn5YORjBOhR4BKEAOp87gdFGmAs=; b=YjrMQpasWRrISnxgxh6pdIVqD/hJQcIx340+y3hCpXiHhNj3XsEIU7FNV2W1Nl87PD B1Qqf1B/z7LDXiPhxuOthdLKGqf/o97DZFHoXEAAYeBrj62LqsJ8r65lZL+oVkwxzYOv ju2s4iOKmwKd38d9OXrdF2TT3QxEtnPNhjdSsGx7VgZS8O9sgaocdEh6WuKtB9oxH1KD QETjpRPnzgMFc78Y7MXO7YxPUmPefA/RWV0u+CgsQCxbHyKNHj3C3G4ylb6is0+tp09R 3w5LfO0H1xxBKwddMy157dEFVBuVeAu5YaDOWJgJsWRRFfF4gM7cRn757/qfJGe5O5p1 UQXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=JJOWpMh0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 16-20020a630610000000b0039c154f8c19si6102353pgg.835.2022.04.07.13.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:17:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=JJOWpMh0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4DAEA2FB1B1; Thu, 7 Apr 2022 12:36:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343827AbiDGORU (ORCPT + 99 others); Thu, 7 Apr 2022 10:17:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231286AbiDGORT (ORCPT ); Thu, 7 Apr 2022 10:17:19 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2EF428E33; Thu, 7 Apr 2022 07:15:11 -0700 (PDT) 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: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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