Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6554011iob; Tue, 10 May 2022 23:24:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4ptAgn/5ecHrZTW7Q9GAEv1nBRE7uTJPvypwmL4Fn2w7mootXMVBR92w7D0AZ3SqsH4em X-Received: by 2002:a17:907:16a2:b0:6f4:eeb1:f7de with SMTP id hc34-20020a17090716a200b006f4eeb1f7demr23314196ejc.446.1652250256294; Tue, 10 May 2022 23:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652250256; cv=none; d=google.com; s=arc-20160816; b=ou4lx0Ym7RPYeaQyRKZBXHqJCAMCBE8Xxh/pPIBiW6/Ab2QhDYkr5gppM3MBGsNVtF 7tnkKeXEu0PJOsUNDh8gG989vC5x7btzRZM2+0N83jO6eFNDzaIxoNi1bGrdBQuguGXS 2cg4EfoBm8SIt/dXIV21A1X5WyRQc2fItQoRpZ1eHogp88IiMwOHTLmM22N6ABpGTNfy nAPhkMvqmpPG7U5US44WfMloELgGdVoonTVbXgxuwoy/8OcQxFkKk5RWZnPYSAIdgjT2 J8qqBSlZYzrIRbNRyGczIIzzAPpnFke2WjO6/Dq7AOkFb3QcNxozOCZPlk0LCYd4xGpM Fk5Q== 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=FU8nuOBOYophOA1hloaA7o9A3ff/ju/iZFOpgx4Wpp8=; b=thZS8jQcXWGmjXPnsoYFiC+h7PU5RrSEk7maYCJ1GSUN+KG0JyyI5MIzc0haB71cKH Am81xx/LDPuL7mhZnTbTHENSdxt+sojGJCUEeSQXKvDtn/PX53uSS72hhFZXPduDHw1u r6uEPtjoQaaMf/56NIL40CxffJMZV5Wp2onkFJ5OvlkH8V2+lFesPtYWnbIC+kw/oqsr PE7EsT4BEnKR8ZyJjUItAkqBBcsE1gKOrApYbLauhyq5wbkr43z323GilgWn6IOgEkp/ IylQ3eiGwZQlWNfDBMVP9gD+JQNYmuty/6rZnCBG5OnQt1Nfq+z7n4Krs7VR9YIWXyR4 SsJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=HsHjcfA4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp17-20020a170906c15100b006f3969d2189si1476623ejc.576.2022.05.10.23.23.49; Tue, 10 May 2022 23:24:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=HsHjcfA4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241622AbiEKCuw (ORCPT + 99 others); Tue, 10 May 2022 22:50:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241650AbiEKCru (ORCPT ); Tue, 10 May 2022 22:47:50 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DFC35DE78 for ; Tue, 10 May 2022 19:47:42 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id p8so779416pfh.8 for ; Tue, 10 May 2022 19:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FU8nuOBOYophOA1hloaA7o9A3ff/ju/iZFOpgx4Wpp8=; b=HsHjcfA4jYrmtymqyGxlfvrOgbtR0AATiQX915JjYpQBDC9guuXBZ5fkE7SC4SChYF eCRgDqQ+NSw6GnyPOXDJn7/wGNIrob6UupYsYC7qxbfIPelGPkuyTnkNTicbaiCNGJN8 VO68ksXNyI6nSLJVESX7gKrwXPnwL1LDVRHBf6pvjX5Rw+a6JS3n/4vilUd7Peitm2On t0uyCGg6+E8MQCu0a6qO6ggWmi5zMvHk318FnjGyYZx4owtdDiFMHB2xz/E4aaxZsK92 CKoj6+GqXS7oBiDvZV550aDCccXaq8KLRXwW2rzA1RwQoQ8TGAaLR5rEbn3V5TPH6/bP TdrA== 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=FU8nuOBOYophOA1hloaA7o9A3ff/ju/iZFOpgx4Wpp8=; b=77eGE7ELpz9DjhQSwdYA4AcaHdQwcmdWkmSrNkEcHMQamBv3PTAS+6XXRh30AxNC5F HVcNYZ8slhnKHVzZpDdeZnHczrODhzPYoMQphoCI8HKIfms/jrNeZusRlTHRYbau4dQH bmbGMVZ9Y5QCO07Ux7+LWHVk4xXRv+4E4jOwR3iaBGgQKaVQ5lEe7vNx8usQgnv0ljoY wkz94tfouVUWjpb3T6AbNCZl9zE9iUk69YpebsNcfCsc//bl1nSFZsOKrLvfdF+01pul StD0+NmtIcw22KElQoFkg9UaC/5WM3iKwNqc92ABBwPWbGNwrGBeEK6exc15qdez91RA /esA== X-Gm-Message-State: AOAM531jI/7qSi/i6tYUKzud73PKL7W9LuUQMtmaqDtjYOxiUvk7pc9G 3e0pbfVAQhaDcYhlmOHkjnMA8mW/BfGPQtREPrJH5Q== X-Received: by 2002:a05:6a00:1c53:b0:50d:5860:5b58 with SMTP id s19-20020a056a001c5300b0050d58605b58mr23066386pfw.85.1652237261347; Tue, 10 May 2022 19:47:41 -0700 (PDT) MIME-Version: 1.0 References: <20220505033814.103256-1-xu.xin16@zte.com.cn> <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> In-Reply-To: <627b1d39.1c69fb81.fe952.6426@mx.google.com> From: Shakeel Butt Date: Tue, 10 May 2022 19:47:29 -0700 Message-ID: Subject: Re: [PATCH] mm/memcg: support control THP behaviour in cgroup To: CGEL Cc: Yang Shi , Michal Hocko , Andrew Morton , Johannes Weiner , Matthew Wilcox , Roman Gushchin , Miaohe Lin , William Kucharski , Peter Xu , Hugh Dickins , Vlastimil Babka , Muchun Song , Suren Baghdasaryan , Linux Kernel Mailing List , Linux MM , Cgroups , Yang Yang Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 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?