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 AE2BAC433F5 for ; Wed, 6 Apr 2022 02:12:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 96E556B0072; Tue, 5 Apr 2022 22:11:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 91DE06B0073; Tue, 5 Apr 2022 22:11:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 797486B0074; Tue, 5 Apr 2022 22:11:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0152.hostedemail.com [216.40.44.152]) by kanga.kvack.org (Postfix) with ESMTP id 64BB16B0072 for ; Tue, 5 Apr 2022 22:11:58 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 1A4FE8249980 for ; Wed, 6 Apr 2022 02:11:48 +0000 (UTC) X-FDA: 79324828296.27.EE3431D Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) by imf22.hostedemail.com (Postfix) with ESMTP id A1061C0015 for ; Wed, 6 Apr 2022 02:11:47 +0000 (UTC) Received: by mail-qv1-f44.google.com with SMTP id kk12so1216605qvb.13 for ; Tue, 05 Apr 2022 19:11:47 -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=wf8pQwHnRNmaHjWr1ZOvrwWsnNuIT93e+BIdPY7Vuuo=; b=eR2P6EjBqwGm0I3XlightluFGFW6/4Q1Fk0IBFVv0J7whG/+EutaNF17I/sCk8/LEf JkTfcbbNvUq52C1a5meMMepcUHtv/+Y3VUv4b4qaz+VXEQshKicKgiNOzSNV+CRAZotn ydZwRQKutAFaqxcZem8W/v46M/8z998iLTS2BguFC0O7aE4d7u6pC4J1nxyntWDQlgzu 9/2x6HcSRhN3lEc5TW3hexP8tzYak8NdWbYTPUUowbw2PGXJe4x0J2dfZpCsMrmmAoBc gc96Y2Eu3GR0Y3I8E8r2dfVQTP2SJct6y2F5NnnR6aMK8wq6UnA0xDVBbs9bnYbRPvP1 bsPQ== 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=wf8pQwHnRNmaHjWr1ZOvrwWsnNuIT93e+BIdPY7Vuuo=; b=ZEMAl5MmYnwcNmLYOM3UfZzveywEeke7Q/HmAGd04a5uCkqu6EuiDx00cuRJDrbBw4 5w/wM8pd+OXoYWkqoOTGD8/PraeePDbgsAHk3WvEoeq8PBIJQmm9qdyT6751I+4RAZ02 A43xjngsja9pqvyu14ubjz9/ggVYMW1eVTV3+FW6cRIAmnwZHn5nPawaMwnb8WuRZxd6 I8BNabX87KEMLgXzu2SRYBO3gUwcZAReIiN3Kyi0mS0MS6iYfG2SAoyZoZWHqr158VHe 838qICjTl52HWa040JYSs0STuz8x+bbewCdKP4aoSQ4ccmUOYcP58p7tYDBqPQ0jrL4Y rflg== X-Gm-Message-State: AOAM530nQd/v5PcrN2uNRFDyICKMJjRjcQYbpv9vVkpwVvwgdE6xTTqs JtNnOd0v68HRbXMrMPDkpzpzYPcvAPf6CnCbrb8= X-Google-Smtp-Source: ABdhPJyy8x2mhTh2XDHSLA1p4xRwU3HMsrpCGyBfNfZ7krWKUNrMGTDCa9f9Xg715cZmJkdqtqzN0Wgck4yDuNSHeqQ= X-Received: by 2002:a05:6214:238b:b0:430:842c:1863 with SMTP id fw11-20020a056214238b00b00430842c1863mr5428680qvb.105.1649211106952; Tue, 05 Apr 2022 19:11:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Zhaoyang Huang Date: Wed, 6 Apr 2022 10:11:19 +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-Stat-Signature: wsfwqb16zt79nnwso34w9u4ygnrqynao X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A1061C0015 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eR2P6EjB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf22.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.219.44 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com X-Rspam-User: X-HE-Tag: 1649211107-539273 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, 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? 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. > > 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. I don't think so. IMO, it is hard to protect when memcg has a wide and random range of its usage especially when depending on scenarios. Does the example of EAS on scheduler make more sense? When comparing with the legacy CFS, EAS does be against to some original design as load balance etc, while it will keep some small tasks into one CORE. > > [...] > -- > Michal Hocko > SUSE Labs