Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp43358pxh; Thu, 7 Apr 2022 13:26:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgfWbL4BETCiiWgor7WamgDpMUvNDurER0cB8tIx1zVpoSuI3kHTGtPG/ipsLSVOpgljWx X-Received: by 2002:a17:902:aa8b:b0:156:c639:7283 with SMTP id d11-20020a170902aa8b00b00156c6397283mr15654230plr.13.1649363208539; Thu, 07 Apr 2022 13:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649363208; cv=none; d=google.com; s=arc-20160816; b=W6UoYIyTYajI8ZuoUgLr4/zV1FqKJJ1r00wHVaJ2uH/jQJLbSUqQFLQHoc2TRoAXMP xH5jvSV0i6hbebvlXxRJXF8OR+T8ilW5aZ10fGdU+mUYvS9gdlckoyHoNNrBYTGBz7SN ezGhCboKwhT/Wu6numEvs6yBJKrrWKw+se9m0dXQPVDR6LcLbgDvIDP1/fgAYbU8Gse8 Y/zdzG1YGA/UXukwxDjGGTq6QSAWVGp7e0nTX3DCbCUWtnVra18MNH898els1f/WtBVA T6z3hkPKJEyNLkbUt2ET/2eY7pfSSk0X4sQwcF7ZRc9ILYEPpvVW8Gjw7DJB8415wd/q tn4g== 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=zqCQYphQwwg0rtGAZWw99jUbVGx79hxU7jjCsADQw+A=; b=oqyuLynZWh4XxcCWlntVNMNGgQ0raLPUZuDFpoNLebRLA5d20/DIhb4DabwphYq+HW m77uws+ILFa2Z3CSOnuF4QWs8ZKQTi3yA/8TOAcOI6cwd3C9P/z8aEm+nVd2UbHPkFI7 19PZFmbGfumooffPu/+DfF9+Ihg4KTIz7+N2AkJLNWuat7GntwCiHGsgMlYm1FNK7AKf OfTU29H90kfMCp0iPZ9uzN73infOhrG89ZTR4B1dley+6PQaSZ750cdPHvO3kFwLaiM6 XYwTPm/CW4rUI/iOHRi92l+Alas1/MVp3o3iHhuziRAxj6l4Dx7Tk8DL90zo28xuQ66P CbKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aGbfgoA3; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id y72-20020a638a4b000000b003816043f0dfsi818350pgd.724.2022.04.07.13.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:26:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aGbfgoA3; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 5FED41EC610; Thu, 7 Apr 2022 12:41:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245275AbiDGMjF (ORCPT + 99 others); Thu, 7 Apr 2022 08:39:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243989AbiDGMjD (ORCPT ); Thu, 7 Apr 2022 08:39:03 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6FB31FDFEE; Thu, 7 Apr 2022 05:37:03 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id v13so2003162qkv.3; 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=pZs3cPstU4kJeolD2fzLS1rBcmCsQmxGOep6IS90N94x8Pb4wzvNCntTUGVh55GaMi ymzIoX+I0AjySh42anryN/37TzzmT+zCjZWGsIYeWM7FH+8MYbSYnEbLjqsSWi32KC6N Wg/Xt7hD0bIxJ5h1YMIWsBa/jrntr2nxy2Cuy13x1zXLhjM85M5bLCSnVlZaDkaMswG6 jFTFysJ7eiy+5ebDmEoI8JszwI3T/ErCZVexqhCcr444Ou8Ysjf9C76QD2/xkKo1oCt9 aJMbj8ibsf2e6ujAc1nVi+I9Zc2DrTyrHMTjoHhvtw703LEMINKTu8vEhehsTbD3xCb5 RcOg== X-Gm-Message-State: AOAM5311tRDyGjse0Q/uBS3Ahfyfh2DPuD754lMypCVh7mPgrU2WKjwG mCU9EJJq0C+Yj/+ez42rZMgsHFj4QTMAJrp3BQ4= 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-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 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