Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp255439iob; Wed, 18 May 2022 01:15:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQs+3h5iIM2mhvJ3EtGldDDoja39I5tMFuH8osYVFV4sCzj3zQIczWjsbn3Cfk1tY8zr3P X-Received: by 2002:a17:902:d4d2:b0:161:b4f7:385b with SMTP id o18-20020a170902d4d200b00161b4f7385bmr5101926plg.5.1652861723289; Wed, 18 May 2022 01:15:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652861723; cv=none; d=google.com; s=arc-20160816; b=k4r+GPNb5vdX5QQoelJO8TVweZ8XUbZPdXXUcqxwcHJxSUGoh2PcaiHkw09CEk5/KA fF5UO6J55WDhhsVBV1mqK+HzW9x0qtZuj855+8GZBuatfePEwWm2kwGjqo+fDmhTBhvW aDlKykY/4sLFaeySmRsWMgGuDCiDcjJRKFWUJ2idXt491hgs1UIE1wQ30rsx5I4E+7ZF 8TCKIY1pSfkbvuYuoVrmAlexyZoI+FuqR912+c+5t/QfCaKjCellMMyEkRIqh2ZnIXAE bGeNuIXOkF54kkr0L+Oj64LO3vjed6REdeYvDRi/BbxiJnRC0ZAu/VoJy2sgKj/KHgaz xjjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WoEf2mJXOA2MejlK2DAjiC6YKTbTSAG0lBrKeEx56e8=; b=Koao8euDUTaS5FI6EVu9Vg07xQbM+daQ5YqYDWdopw7mrh++QCFZgdw9PGHBMg3Ts9 bs74GIuiqIWsk8AloqZm7CpAvO9cy7idDsuRzQwRIcCH0WmpcOep0BGWAWJzSyu/5N8c Q+xV8OgvI/dYIIWy8A1RfPJrzkgcVpZ+3iKF35QP8t4ElyVK37lJ3q7wTJyhpgHjmN97 nYxunvUHDhNuHIwsjxtTH39pi8ZSv27ivm9uf576g7UiNpM6Oeq6Nkrcn2CR69lzASKl wgXfN5eXdV5zn1DnU6kOv8+bHFlI00wEcm0PgGfog4kGFJD6ipaWAYE2gbn+mK5wyaWK lxkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JnJoLDdO; 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 s22-20020a056a00195600b004fa843103dbsi2463032pfk.193.2022.05.18.01.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 01:15:23 -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=JnJoLDdO; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1390E8D6BE; Wed, 18 May 2022 01:15:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232799AbiERIOz (ORCPT + 99 others); Wed, 18 May 2022 04:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232798AbiERIOv (ORCPT ); Wed, 18 May 2022 04:14:51 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC75E81998; Wed, 18 May 2022 01:14:50 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id m12so1092370plb.4; Wed, 18 May 2022 01:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=WoEf2mJXOA2MejlK2DAjiC6YKTbTSAG0lBrKeEx56e8=; b=JnJoLDdO3Cr3yxlTa2CqxnmoSJWnIgeN9bE1GtOXbZrEi3HH/aUCbqqMPQ1XBmuuDJ CufWXNwnV9NyvbwBtELZ+WkzLZdqsS56GMSgC3kQHMqjWqfnT54P/ue6lfRVzzV1rzES wv7OaWRhgrmMWDNDK1pwopJLJlxnEoS5IjKy8hCTeBmUwvvlS+7icQS5kLusciC2wXhC /hjwWCtRUTnnm1EOpgUHfBmvsFlrP2rmD8SQkTzy4+4aCHWzXXDc+KhJObrWWetXXoMe tujFvcq7DTJF0XhdEM/hvgE+S9mIuWOC9YkMxDtHXmov36dPVh6XKcOavrVzsBQbmrbn VAOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WoEf2mJXOA2MejlK2DAjiC6YKTbTSAG0lBrKeEx56e8=; b=yctqLtarydGG2NaEbnYVf0NrsDmlgZR0fh77sHgmTGfmFVcwEk0O+qRM4zawQmyvwM 6HJZFQpKKHOwnhIjwt57QLPB1X8GSWeRlWp5/zhIrTaBb+eeHpP784glCtd523E5DG3D NE/xGIwX0GjqIwrLDE2jK4wVW0jtMFqQQqjz4EGVHtAv0JZxoT7G4ilnxcrNnojospqa OCXGgaMIblr84ngWcvIU3GgQHDHnzHCPa/NGfh7KXa9UU7pQl7cbeQyBiIHicFBfhl/v iwhRZVCvtGkXETcYqi9O5iUmjNiW6dONk4pADd/Ja9JDHcqlanrBszzaJkwSWQTelYru YFgQ== X-Gm-Message-State: AOAM533sAD50AxoWELYxVok1v1g84M2VLA/tC95/jpwJUsMrIKrN1of8 4n7yqOOwaHYCJdxb98hRq4Y= X-Received: by 2002:a17:90a:4f05:b0:1df:afae:180b with SMTP id p5-20020a17090a4f0500b001dfafae180bmr2507522pjh.80.1652861689818; Wed, 18 May 2022 01:14:49 -0700 (PDT) Received: from localhost ([1.157.44.177]) by smtp.gmail.com with ESMTPSA id d7-20020a056a00244700b00512ee2f2363sm1290401pfj.99.2022.05.18.01.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 01:14:48 -0700 (PDT) Date: Wed, 18 May 2022 18:14:45 +1000 From: Balbir Singh To: CGEL Cc: Roman Gushchin , Shakeel Butt , Yang Shi , Michal Hocko , Andrew Morton , Johannes Weiner , Matthew Wilcox , Miaohe Lin , William Kucharski , Peter Xu , Hugh Dickins , Vlastimil Babka , Muchun Song , Suren Baghdasaryan , Linux Kernel Mailing List , Linux MM , Cgroups , Yang Yang Subject: Re: [PATCH] mm/memcg: support control THP behaviour in cgroup Message-ID: References: <6275d3e7.1c69fb81.1d62.4504@mx.google.com> <6278fa75.1c69fb81.9c598.f794@mx.google.com> <6279c354.1c69fb81.7f6c1.15e0@mx.google.com> <627b1d39.1c69fb81.fe952.6426@mx.google.com> <627b2df5.1c69fb81.4a22.160f@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <627b2df5.1c69fb81.4a22.160f@mx.google.com> 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 Wed, May 11, 2022 at 03:31:00AM +0000, CGEL wrote: > On Tue, May 10, 2022 at 08:11:16PM -0700, Roman Gushchin wrote: > > On Tue, May 10, 2022 at 07:47:29PM -0700, Shakeel Butt wrote: > > > On Tue, May 10, 2022 at 7:19 PM CGEL wrote: > > > > > > > [...] > > > > > > > > > > > > > > All controls in cgroup v2 should be hierarchical. This is really > > > > > > > required for a proper delegation semantic. > > > > > > > > > > > > > > > > > > > Could we align to the semantic of /sys/fs/cgroup/memory.swappiness? > > > > > > Some distributions like Ubuntu is still using cgroup v1. > > > > > > > > > > Other than enable flag, how would you handle the defrag flag > > > > > hierarchically? It is much more complicated. > > > > > > > > Refer to memory.swappiness for cgroup, this new interface better be independent. > > > > > > Let me give my 0.02. I buy the use-case of Admin restricting THPs to > > > low priority jobs but I don't think memory controller is the right > > > place to enforce that policy. Michal gave one way (prctl()) to enforce > > > that policy. Have you explored the BPF way to enforce this policy? > > > > +1 for bpf > > > > I think these THP hints are too implementation-dependent and unstable to become > > a part of cgroup API. > > > > Thanks! If no other suggesting we will submit a bpf version of this patch. > What is your proposal for BPF? How do you intend to add attach points (attach_type) for policy? Is it still going to be per cgroup? Balbir Singh