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 92473C433F5 for ; Wed, 6 Apr 2022 08:21:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 140D26B0072; Wed, 6 Apr 2022 04:21:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F0F96B0073; Wed, 6 Apr 2022 04:21:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFA696B0074; Wed, 6 Apr 2022 04:21:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id DC6D86B0072 for ; Wed, 6 Apr 2022 04:21:46 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A0F5F24553 for ; Wed, 6 Apr 2022 08:21:36 +0000 (UTC) X-FDA: 79325760192.04.CA8EFF3 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) by imf27.hostedemail.com (Postfix) with ESMTP id 0F7F740042 for ; Wed, 6 Apr 2022 08:21:35 +0000 (UTC) Received: by mail-qt1-f172.google.com with SMTP id b18so3038979qtk.13 for ; 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=YX/QIR4uWPJb5Pko6dNNWFPbKpBFiocfBKuFAt+J1RVeLBSJGNXHmxRFgCWtxhFBN/ PReXgRwrkfwQwg5RCDCX0xiaKQlJyr+GrzChR8ewry/F7qibAjmXJRxYaTuSL1OL8zm6 e1yFewloU9Chc1YlcbgBhu0WqwxIih+GcwxbuX2R+YK5DutQDFSoWX+jXjnbjN5ygjiE H5I75K2057Ei1kGw53rYpKoE7X1NdYPl6l6q4ONpY/9kllYSIhvkQHdWQX4Ed6pLaBQ0 5+LbU2oan/zKgaBfebzskDO/HK1TKMYVlFlnTr2gcxXnkPR3m9d6gZLK5ahtqdTC1PR/ YuNw== X-Gm-Message-State: AOAM532bYaCSIQuzJ3uYXicwhPcz6bpXPAv39YhqOA10+U6snj9ibogx koBkwSGxe7B2ojnfxhMf+pJ6ugzM8CIfDq4apoY= X-Google-Smtp-Source: ABdhPJwsFaRtyZQjBJn9zBMfC8Nfx9hxl1Be1gb/G3G6j10kQniywe6cDREOy6skFWkz8Y7S2TA7wlgoNtxnX5qnP0k= 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-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 0F7F740042 X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UdajeAwz; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf27.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.160.172 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com X-Stat-Signature: rjqjicxd4uto5xttg7gb7mqe11gwjk9k X-HE-Tag: 1649233295-5648 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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