Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp168352pxb; Thu, 7 Apr 2022 02:12:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsu90OMO44dVK27n00pUHOtnaSecCv1sMTbLE0nrExxl/9J6r8p5RGXs+xfL22vymX3swk X-Received: by 2002:a05:6a00:331b:b0:505:67a1:1e08 with SMTP id cq27-20020a056a00331b00b0050567a11e08mr2008984pfb.71.1649322742576; Thu, 07 Apr 2022 02:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649322742; cv=none; d=google.com; s=arc-20160816; b=xE8FJD0Bx3htTgs/6oCIH6l7J0zKWK/6JkXaYdflaKSvshCTBIkjWuqRyzx3F0kTUk mosl3Ur4vJp1QE0NeENP/WVDBEi8g3+5mf44aKPfvO+x9t34JQ8mgdGsVmeI4TGi6kM+ tAdLIl14pvzfuLU2t1Pdhjg9DnyRQ/Qwp87IlTOLY3oa/lscDNRZ30UWMLKiHPchBQI7 40aSHGgdf084Of2DrT5JD+ZyNxSB0cFkFxxNQLfndVhnVwWfHt9wKp79AkGkBnA21ng6 abRoI2J8nTuskTvJUk4yXuUvBTQEi2T9dV7EGRSE9/B8jbiDYldQQ0M/PB7TPRyyVdZR qXkg== 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=7tdKrRRhBcgriuTuifhqw7ASOmfz1N4EF+9FSFvKM0E=; b=CZcXpvO+oP2gdhsHkG7YwnxnKMj9E13pCiXarGKj3pYaOEqHjjAQcR13CLtyTvWF1c +aYzvoDI7dQLP4MTVB2mC+CtqdiGrfRcqOFJZfARUvIEarvF31pGsINZBd2kY1waujb1 Av3nYQUOVdXg4DqEh0KgRGfsWG9x37S8olqW5vPuUYP+XRl/ERvZkxXPEruVo9awXX+7 wTx0Vo7c+lSUsJyC/xalMjhE5qdyysMsQUt5y9ZRleUjVbroGH+qytgsGRCJL6226UYE 7wDxFjmB0/lhaLd/ckc9MkCFZ6yIANSblIRJMhowuBufwrKrNext0OszgDb7OGykLhDj vbkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=r6Fua2gz; 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 w15-20020aa7954f000000b004fa661777fdsi17470064pfq.298.2022.04.07.02.12.01; Thu, 07 Apr 2022 02:12:22 -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=r6Fua2gz; 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 S242008AbiDGHmn (ORCPT + 99 others); Thu, 7 Apr 2022 03:42:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242001AbiDGHm0 (ORCPT ); Thu, 7 Apr 2022 03:42:26 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C71C57E5AA; Thu, 7 Apr 2022 00:40:24 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id A15501F85A; Thu, 7 Apr 2022 07:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1649317223; 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=7tdKrRRhBcgriuTuifhqw7ASOmfz1N4EF+9FSFvKM0E=; b=r6Fua2gzlgwm1Hp5y5shaiTcDw1GVtrXgPXQb3p55UEWWygcN+jDp11/05+NYmm1vYKIPm 7lKd36aXjuqVnfrCXhRi1YOIr/f0RG7VdejwUm/BA3RtBxq+NH8LIxlM76mVrvdJ9L4eTi qlUYyggclZvcVPbb3HDCBf6Y35i3cPo= 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 DF5F4A3B82; Thu, 7 Apr 2022 07:40:18 +0000 (UTC) Date: Thu, 7 Apr 2022 09:40:22 +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 Wed 06-04-22 10:11:19, Zhaoyang Huang wrote: > On Tue, Apr 5, 2022 at 8:08 PM Michal Hocko wrote: > > > > On Mon 04-04-22 21:14:40, Zhaoyang Huang wrote: > > [...] > > > Please be noticed that this patch DOES protect the memcg when external > > > pressure is 1GB as fixed low does. > > > > This is getting more and more confusing (at least to me). Could you > > describe the behavior of the reclaim for the following setups/situations? > > > > a) mostly reclaiming a clean page cache - via kswapd > > b) same as above but the direct reclaim is necessary but very > > lightweight > > c) direct reclaim makes fwd progress but not enough to satisfy the > > allocation request (so the reclaim has to be retried) > > d) direct reclaim not making progress and low limit protection is > > ignored. > > > > Say we have several memcgs and only some have low memory protection > > configured. What is the user observable state of the protected group and > > when and how much the protection can be updated? > I am not sure if I understand you right. Do you have suspicions on the > test result as you think protected memcg has no chance to update the > protection or the global reclaim should have been satisfied with the > reclaiming(step d is hard to reach?). Let me try to answer it under my > understanding, please give me feedback if you need more info. The > protection is updated while mem_cgroup_calculate_protection is called > during either kswapd or direct reclaim for each round of the priority > reclaiming and then the memcg's lruvec will be reached in step d. 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? > > I think it would be also helpful to describe the high level semantic of > > this feature. Please focus on this part. Without a high level semantic explained we will not move forward. -- Michal Hocko SUSE Labs