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 78227C433F5 for ; Wed, 11 May 2022 03:11:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 01CC26B0073; Tue, 10 May 2022 23:11:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F346D8D0002; Tue, 10 May 2022 23:11:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB02E6B0078; Tue, 10 May 2022 23:11:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CC4EA6B0073 for ; Tue, 10 May 2022 23:11:25 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9E65C21E33 for ; Wed, 11 May 2022 03:11:25 +0000 (UTC) X-FDA: 79451986530.04.BDF05D1 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf18.hostedemail.com (Postfix) with ESMTP id 92BC81C0093 for ; Wed, 11 May 2022 03:11:14 +0000 (UTC) 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-Rspamd-Queue-Id: 92BC81C0093 X-Stat-Signature: 5h6gjha7cmooay3h9gswabb1pfrousf7 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=gnnizCg1; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf18.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1652238674-654597 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 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!