Received: by 2002:a19:651b:0:0:0:0:0 with SMTP id z27csp5088268lfb; Tue, 10 May 2022 22:29:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzstA2mqcf+CCc7NGOHfgMp/ZCCmxOczH/lM0LUSgUL1VKlzDY44aEcu43cnifAgV26bU4O X-Received: by 2002:a17:90b:1c04:b0:1dc:32dd:3212 with SMTP id oc4-20020a17090b1c0400b001dc32dd3212mr3558694pjb.35.1652246967782; Tue, 10 May 2022 22:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652246967; cv=none; d=google.com; s=arc-20160816; b=EXvUPXBhNB2xWxdrPBZztKCSfDpFRsJ9ZSRuYXY7OSXThfm5jdI4p0YSRRrXp7AScx WgL1rNHtCUZGYIvAbgJjuEAAMtgDRoEMgUUGDqz5F0OP6YXshiCwdWb+7Fa7O7eCbOIx sYHsEjV31RfnNTZC8iLArN9IMzcGI5nwZcTsbkBWtMssOPRB4rQjh33Jk1nN+mM0NyPe eoY2e7c6uVRNXRCF8lEQ9HC2RUp7bxi2R+sets6tSW3kFK6UZt/pTWCW4qBxJKNDCLnz NIqJ7yKmq8hT1UtziCHQdpxYoF1KCocT6zG2Es6jbsENFeQNQttjvpTwRrGff3a5fOyB /s0A== 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:dkim-signature:date; bh=8UHed0uiQg7plMIS+d8Hr/ojdF24QkSbiog6M6TLs1U=; b=mL2sPbesB6uTxg3tpP3T30ZeOe/wsNKotJfwkCLETDgmX2zCrMMqfqU8Kdae7NqGsy 2KwEF0hTWz60l97O1TqcX7qHwS3Qmr+A0xYBjmfNf36zsSQaLKfr2L8G8UVRE2Sr8sLi lvppnfWzppUIZQkbe+U38qy3r7EPlz3c/nmQTvHFgiTE4QkgQlU7+GsBQDFr6NaMfWQg LKNalJK3c5QVhQe9nCIeF2+WH34kDeVAj4vMKDMzeprEpAV6JyeOmLh9/2T8SeaoyahV iPtU/604R8qLeXkdHggKdQMy8YdxQnPmMW1DHCMTgi53BbH+qYknYVpHg6+QO340BYEh i8pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gnnizCg1; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12-20020a056a001a8c00b004fa3a8dffc3si1305161pfv.122.2022.05.10.22.29.16; Tue, 10 May 2022 22:29:27 -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=@linux.dev header.s=key1 header.b=gnnizCg1; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238378AbiEKDLh (ORCPT + 99 others); Tue, 10 May 2022 23:11:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232409AbiEKDL2 (ORCPT ); Tue, 10 May 2022 23:11:28 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8CAE45530; Tue, 10 May 2022 20:11:24 -0700 (PDT) Date: Tue, 10 May 2022 20:11:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1652238682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8UHed0uiQg7plMIS+d8Hr/ojdF24QkSbiog6M6TLs1U=; b=gnnizCg1quxOzlHtzeLqGl0Sze8T7KWis2CGpHRM6kBbVTfG4LZYN8pexQWnSjQ5FP8acs PYMS/zpRaeE4pP/ZWDRExv0v1tbxT+qGew/WOAapbTGo/H4cqYJPy8VIUFMJAGJRe32XWn zM0jfZ40CAm485b9ybWd/ObltE7aI4U= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Shakeel Butt Cc: CGEL , 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: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 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!