Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp329441pxb; Thu, 7 Apr 2022 06:51:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+G0peEPtlVtcoBMSNN7LzoKgRrfNS59lkWjpei8gcfXZ3nRmHwj0R0ZTxY/pplJXh5Di1 X-Received: by 2002:a17:902:9307:b0:154:78ba:ed40 with SMTP id bc7-20020a170902930700b0015478baed40mr13978121plb.92.1649339466532; Thu, 07 Apr 2022 06:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649339466; cv=none; d=google.com; s=arc-20160816; b=HS075tcaeZGPbs0tHjbakq9npYf507YFEfxJ8pWAk81DaeIHAL+JOmrE6FS1FuIKUd O8XVcfBXj/rIyvr8soYiVemeOcH10o7Wvv/T24ikxpufLZsSTiqdSQUtHAZQbY+B7hVj Mt05cdneVYXMRPl6QF04t8hFdKIs19xzigmbyx38oR3hZ+EXEpSE0Tmzf7cTL6dOkVNZ SU2nRBcEfHSSzOCY4i67av2U6B65VB2jrJIaKXD8L6TSg4jppJEmk1BZsrj2Kv8qqbY3 8pqtZYbxbve7WWtx95DOm5GOAb45sdkhtLM8vYB3z3YgAzWzItU/tNXEfsIsTmrufv5B mNMQ== 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=tNtnnv47l8kZs+TIL27Yd98JmTykdLmyWqvUcwUs4bc=; b=1Lo3EoE8szLrokkIX3+prLe9PXB9DzGQCFfdpPb5YlKcySCg3C01772QxdKp0CuR3F eTmb9ADsxBTUQtwTegA6RJZQJdVhYMlWKr4YlMdIARP/fKxniPwl/5VI5cmXnPfkEAVC NRw68lZgB38n7vtOgz0UZdIYf58c057i27Q6LXLI0y2HR9kZX8Vf+6URxHLTI/DIsY28 BZ5QQm2vCzXqzpODjirYSlrKo2rIUQR+XVypr9b4Rdi1OoiaAJuF09KIG97abHu+G+Vl o0OsimFoxHw+RIOZTAbikE/jW2LoVgTn+9H2Cwh4BShtFSjVUmZZSSPPM6XpwuxApUlx 46hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=YvvqO5eC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k135-20020a633d8d000000b00385fcbf9b16si18145619pga.533.2022.04.07.06.50.50; Thu, 07 Apr 2022 06:51:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=YvvqO5eC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243952AbiDGJq2 (ORCPT + 99 others); Thu, 7 Apr 2022 05:46:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243953AbiDGJqS (ORCPT ); Thu, 7 Apr 2022 05:46:18 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFC9AA9959; Thu, 7 Apr 2022 02:44:18 -0700 (PDT) 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 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