Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1038404pxb; Wed, 6 Apr 2022 07:16:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvoQkaEavKXEZ5dV/m0atOS1kXTMF68ou8/NJcrnD9pOpKEgq4TWy+lx7FEl3uWBg7RL3l X-Received: by 2002:a05:6a00:2402:b0:4e1:46ca:68bd with SMTP id z2-20020a056a00240200b004e146ca68bdmr9096010pfh.70.1649254606204; Wed, 06 Apr 2022 07:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649254606; cv=none; d=google.com; s=arc-20160816; b=hQnH4J0WFy/8YHaOJBTYOW4ZKQuefZd3NC3ca8u0I6W6FWiU5E+OY0C2VBNwMmaDDR yQS/5KYIMffMsKQgTtORjKAejb171TQhxxhC2+piSrvNHif8d7s+FY3uyGdU/ikwIKAl WjBnT6Q431LS3p1C6fsKbMaadpfOqq1aDm+Vle3YziAffTy8PYDH/UkijGjUH/KyO/Vc bRANpoVA0Ia40zbTmBwuwqgSM1q5QTIEDgsDOzirTf1WDGNWvBR+WjSWEpfPbNsYz3zE 18vqseOacVLOB2aJScNXbJHZ81ZRdPxjwKF7jHo2zD/vHVdGd8ykk3BL8vclZmBPn5Ny zNnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=AFWezyJlqZ77VORHX3U0GwJuhQRt/uhTxdefuNmt42Q=; b=HjaRzdGCPCtrqsDH/jpHF1Ipk8a78la+kf8khswecnSw48ABANwM9Lc8cHGx8fPlK6 KKxKgQ1KxBdaDFq4LrWWJNoTTCPnkbTXs3It3/ZLn7rJQzh7vpoxSisljaMR/OyfUFWp AeTFWuQpnwe7YGL9Dp9wuSWJKrWEuONKbNvF8mq+eHedJwvivGeNmwtVvgbCMv+J+FTi U0ohdT1Mn0PMKDNxlA8NWfguMdB2vMXs1LBqrZjKdWRtdswTmffR2QbDlHzuw6GnxC1e v0BrsenFJmov6ZKkJiNOGBCJ+zL7QdwuT+qt4gOKdG1vh1a2wHHVlVNHjV9WH3WiP90V i5ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UdajeAwz; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a2-20020a17090a740200b001ca8947e749si4976304pjg.20.2022.04.06.07.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:16:46 -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=@gmail.com header.s=20210112 header.b=UdajeAwz; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 56A98469EDF; Wed, 6 Apr 2022 05:02:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236171AbiDFLdV (ORCPT + 99 others); Wed, 6 Apr 2022 07:33:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236007AbiDFLcn (ORCPT ); Wed, 6 Apr 2022 07:32:43 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06A1149FA17; Wed, 6 Apr 2022 01:21:36 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id t2so3093276qtw.9; Wed, 06 Apr 2022 01:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AFWezyJlqZ77VORHX3U0GwJuhQRt/uhTxdefuNmt42Q=; b=UdajeAwz5lRZFRXbxD0b6WdicDco/5iM+47a7VFFMBjwCmLgcEiDJIg7nWDLO+ji2k CkNHMl6aooBimIBDkw/xp6u2yjv2xEGsx/+kzbYrNShkzRVLJwOLOsVjqzHpMfixnZl0 4cO/49izpHp3ca9V5F8qjww8XY3WRZZdDjbY1cVxZQ6PVn0vDIhLZbqfkykB9fzQOIBS KLpAKeY80xO37Hxbxzf4fCFAt1qxkfTvaCNHYh7wyNmpF0A4E3DVm5LVNtc9F0CaxlME /pd/fLotihhQ0LroBEuHJKYI64RmS2669IZmn3bOJWVpyEvNOfNmQwixkMW+TcsM65/G tUZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AFWezyJlqZ77VORHX3U0GwJuhQRt/uhTxdefuNmt42Q=; b=OvFkU3J7EyonMNQlvjKl6AMT1EjpYqR4wazMB2rYjFK/q2xL5agQL9UTwtn7brNO/n v6c465MRq2HJa1Ak0Fc98VD2sumWWk4x+4C+Vi0KForeRCjXvgOeD834VQ7aYiGe59yK NEdQ2lcHpzDaTzsXSN5vr6PKpR+HHqCRJgZfnp5okbZX/DT3MDnew77xKx0+IEh12lyp yoLonaGv5/UF0Se5L95Z34yYdz19LKdidGcphU1RWclDI5btrBhYh22l5tBIceqFeA/s IVPUnFY261t9fcB768IXNsJNyM0+BnmrXo5Gh7EAvSg7hgVChe5gprp32/P6CtPgtSoc v+Xw== X-Gm-Message-State: AOAM530Vf+cwbbgJXkw2FXFoQq0Nk4MJA5eZqDCHUAmBfbE+eFE3Sjot 66kpQ0TTHHFL7Ks6qejCVCP3H7selM8323gijUA= X-Received: by 2002:ae9:e513:0:b0:67d:2bc6:9620 with SMTP id w19-20020ae9e513000000b0067d2bc69620mr4910453qkf.453.1649233295174; Wed, 06 Apr 2022 01:21:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Zhaoyang Huang Date: Wed, 6 Apr 2022 16:21:07 +0800 Message-ID: Subject: Re: [RFC PATCH] cgroup: introduce dynamic protection for memcg To: Michal Hocko Cc: Suren Baghdasaryan , "zhaoyang.huang" , Andrew Morton , Johannes Weiner , Vladimir Davydov , "open list:MEMORY MANAGEMENT" , LKML , cgroups mailinglist , Ke Wang Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 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? Ok. I guess you doubt why the external reclaiming on global LRU or other unprotected memcg does not satisfy the requirement and have the protected memcg have to face reclaim? According to my experience, this is common for a large number of malloc from userspace OR high order alloc_pages within the kernel. I have retested the previous case by removing mlock and get the trend of result is same, where the pages on global LRU could help to push some of the global memory pressure back to global LRU and finally reach the protected memcg. > > I think it would be also helpful to describe the high level semantic of > this feature. > > > Besides, how does the admin decide > > the exact number of low/min if it expand from small to even xGB in a > > quick changing scenario? > > This is not really related, is it? There are different ways to tune for > the protection. > > [...] > -- > Michal Hocko > SUSE Labs