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 0F8FEC433EF for ; Thu, 7 Apr 2022 12:37:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 934636B0071; Thu, 7 Apr 2022 08:37:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E31A6B0073; Thu, 7 Apr 2022 08:37:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7AB646B0075; Thu, 7 Apr 2022 08:37:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id 6DB956B0071 for ; Thu, 7 Apr 2022 08:37:14 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3C258AA22B for ; Thu, 7 Apr 2022 12:37:04 +0000 (UTC) X-FDA: 79330032768.27.A100DF6 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by imf20.hostedemail.com (Postfix) with ESMTP id 933C11C0009 for ; Thu, 7 Apr 2022 12:37:03 +0000 (UTC) Received: by mail-qk1-f174.google.com with SMTP id bk12so1995789qkb.7 for ; Thu, 07 Apr 2022 05:37:03 -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=zqCQYphQwwg0rtGAZWw99jUbVGx79hxU7jjCsADQw+A=; b=aGbfgoA3tkur8brwef7kNg7t1ICec7XOSo1+xO3axQPqmqJMR4SwQDy9Ro8HMErUIw EZbH6DzmcCOFb8F3X/ooGfjNIjvTEoV9Idv/rym45HJvHuXWDJ/27yYnbmkNdo5fY0up kwxWkmaTAm8lkFyiITVQGl9aqg4Bwbj7QmsIgihMOWOZ5IP3Uv/Wv1ymFGr7htmaDWOr jv4VkZwKyY7weM1wt9Mr1kO6azVn1GBfjJP1v2eHObkxUWfZNieBrrMDvsgoUivaw+8A OIn/XsaBiCgWfNmJwrdi76Rm5irA1oZ87NVq3rl205OAtMdKAzj7Vp+1u5jmzo8Wp5rp SyDA== 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=zqCQYphQwwg0rtGAZWw99jUbVGx79hxU7jjCsADQw+A=; b=ow4rd95YNVGhYmpHC1zMUgTF1KRaVwJfZ3tEfyTBos1Is4xpV75+wOQc+JtifqegxY dOZyqbcoCZyJtt0EvRhxUDELxFYzIlOV1nuzWjWz8nZAIX8SlNT34MUrMgcYDueVk8Ik qrl59WKKE+QVB2C3I1Gjzy5Uvxa7NB5pMqtqSsMuQAgF2Crb6gK66oy3N0wlemVhOfn7 1cjY7Wz/Ly+N6s8qgFWSrwFtZ/vkhdxToRUWTDf09RzqQLJStpHNqOqo8xS3ROMucvFv zIknvzWXWy3j8lqna9yzhwNOwSWUojizx+6mh5RxsDnv5dvpdQYDrmuT0y17lpKNYlW+ tE6A== X-Gm-Message-State: AOAM533ZDxINZsPnu2buJa8fBlTo4HwldFYGMhxOT/DbOrMqRZ/EaV1J BLB1belydCpOtqdMMyRDn4UWVvbCsD70bO8tynM= X-Google-Smtp-Source: ABdhPJw0qd8D9C6tmj7Cp/PFc7wTcv1WiDGzwESl9F2XASgK1yJsL++x37ZL/w7P0FMjkK/xV8hIwvH2jEqpCKtUykE= X-Received: by 2002:a37:9b91:0:b0:69a:48d:54f2 with SMTP id d139-20020a379b91000000b0069a048d54f2mr1352402qke.476.1649335022765; Thu, 07 Apr 2022 05:37:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Zhaoyang Huang Date: Thu, 7 Apr 2022 20:36:51 +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: rspam04 X-Rspamd-Queue-Id: 933C11C0009 X-Stat-Signature: tekdq1o88mn41jbzjtz4paknodrjhmnx Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=aGbfgoA3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf20.hostedemail.com: domain of huangzhaoyang@gmail.com designates 209.85.222.174 as permitted sender) smtp.mailfrom=huangzhaoyang@gmail.com X-Rspam-User: X-HE-Tag: 1649335023-931746 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Apr 7, 2022 at 5:44 PM Michal Hocko wrote: > > [...] > 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? right. But I don't think the original protection is soft which could be proved by the test result that the memcg is protected in a certain range of pressure and could also help to release the system by breaking low limit. > > 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. I don't follow. Does it mean that the protected should distinguish the pressure from global and other memcgs? I don't know why. > 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? Actually, the purpose of this patch is to free the userspace during runtime which require proper setup of parameter and then let the scheme decide rest things. > 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. This kind of memcg is supposed to be used by the user who is aware of the scheme and would like the scheme to perform as it is. > > 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. As I have mentioned before, EAS scheduler is also a self-motivating scheme which is based on load tracking and energy calculation. The user could also be hard to know when the schedule entity could be scheduled to big core. The admin could turn it off if dislike. I would like to push this patch forward and get more feedback from real scenarios. > > Best regards > > > [1] this is based on the global PSI metric. > -- > Michal Hocko > SUSE Labs