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 B0AC8C61CE8 for ; Mon, 9 Jun 2025 17:03:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2F3846B007B; Mon, 9 Jun 2025 13:03:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CAD66B008A; Mon, 9 Jun 2025 13:03:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2082C6B0092; Mon, 9 Jun 2025 13:03:11 -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 028C76B007B for ; Mon, 9 Jun 2025 13:03:10 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2B964120901 for ; Mon, 9 Jun 2025 17:03:10 +0000 (UTC) X-FDA: 83536482540.14.10514B6 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf19.hostedemail.com (Postfix) with ESMTP id 7971D1A0019 for ; Mon, 9 Jun 2025 17:03:08 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CIh5Y5+d; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of tj@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=tj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1749488588; a=rsa-sha256; cv=none; b=Vz90exKlndLFzpNzkEgiypYbg5aQKFDdzUDx80+P0u26onF5zTbgLgesowcy0ggYhaZNxa X6xvabxcewuuTwmoRAl/qnOIMZZ0SFFV8HzK/5mcjPBFhyb+ezvMwn+FtL/Mq1/mOdQ9IO QL5OGHSSGCRGdwcJg2zzyKgrYh2baB8= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CIh5Y5+d; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of tj@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=tj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1749488588; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/cNeLXiq6Prg7o58YC+vUMgAVUqCClOj16fnTJhtyW8=; b=D0apN+PEw23wSpsPA4bkJCjbfNu5pIh9Qnhe76Tf3hVk93su6dXvTe6CgzQh3Wa2duf/8v IuBE12I84KpAoz11KTbBH56Qv0Z6HJoYZaQKZqGdSu1elJYjq53H7srmHZveoKwKG454cS fypGjxa4spGZB/qVW4p5U93wbF40ej8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id D6403629E1; Mon, 9 Jun 2025 17:03:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F812C4CEEF; Mon, 9 Jun 2025 17:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1749488587; bh=VkV6JQ2FgHrRghDrC224nNPTDQSS5mIgKE9tQeHSFms=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CIh5Y5+dVVuggziHsrY1euQW4YM6CCJ6DFFV/pTkc1q+JgeIoKw7nmm5WSYCephi8 VvlOELS97KNeFSJBXCQEhco7k6T1y6yf9D7GRgAZe8Y5HVMVXcVO2cFV2hkWMLN3n6 gV3PTNLjOy+avX2ube/P/tMzEpLPAJw2R96tcwL5eQnEMGttICYytrgWWxyuF9Kg7J zJunmPkmo3xQF2XEm+weySG24pGepoONvjDwUKQjXuD7xhNrb4xNZl5MOcRsvPDTAs UAlr7rBGlp5iojWTzXyHVi50cq3DEFh8i6N7fJWb1YVip8MJmagzRV5LLwWfQ9fi7U 1f/qV93uJuX7A== Date: Mon, 9 Jun 2025 07:03:06 -1000 From: Tejun Heo To: Johannes Weiner Cc: Vlastimil Babka , Matthew Wilcox , Lorenzo Stoakes , Andrew Morton , Shakeel Butt , "Liam R . Howlett" , David Hildenbrand , Jann Horn , Arnd Bergmann , Christian Brauner , SeongJae Park , Usama Arif , Mike Rapoport , Barry Song <21cnbao@gmail.com>, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Pedro Falcato Subject: Re: [DISCUSSION] proposed mctl() API Message-ID: References: <85778a76-7dc8-4ea8-8827-acb45f74ee05@lucifer.local> <20250529211423.GA1271329@cmpxchg.org> <0aeb6d8b-2abb-43a7-b47d-448f37f8a3bf@suse.cz> <20250604121923.GB1431@cmpxchg.org> <20250605123156.GA2812@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250605123156.GA2812@cmpxchg.org> X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 7971D1A0019 X-Stat-Signature: twpuwxda7twrwndk1az5npy68yke7o41 X-Rspam-User: X-HE-Tag: 1749488588-615803 X-HE-Meta: U2FsdGVkX19vZwtaxYO9gyqQ+R14Gkl9S0yD8U1ybKgo2Z3Mf8+dtDc/F+lSIR3oReJBvFfR/ci7aNjPcNHYBcDTM9ZIgVwfwI+fRWYIIB2WlPVB96zhA72vetQy1iHV440d9kuV7MIXE+En4ITu5rYsKzQKGKNjzlMxRzcz7MdxeawLPohxHTajKjjBUkklZnaUn8PuCZze/yULf/Uv1TxT5tAAi9RQ1eHa6CQSfGPop6GJsPloi3tphqQ2LeKITtCDCiy5tMMQQAoB10xXXya0TDRqPl7yOkDjSo8M9zUcoSXMPwQiJo3DEZ56njfr29fgIvE0815HFCxftS4yK6OMbFJuixFxpfOTFxjuwlyYDlqSYOldp9fRl9eN9E+hmrDkOv7I7RarEcyB6Aw2uJNfgdJu6xta5QzXC8/VG5xpceKfBY1x0Ve37PYuxVFx178ge8mzljG3gFz/AIeg1xDWcpxuKpT4jdNu9zMShnkQqyIcJRgHvWvk8qp5YPvS19mkq7aVTg8eYZNP1uwq8UCCWqw9thI2O/jsbNM2elm6KWj+g6BgfH1CPYLMTAkLKneYERl0nDIHPi+7FRAnCfrPrHoHLyslslaxSA9i3Po+BXTh0EjUy/bttqMEL15LHatVhMmJGJXDDGFISk9OBPsAnITd90x45GiBTiuBWU5kpLEU988Q7OsMxwZo0eGM1xCZPWm6t0NgKXGxsJiP+A0WSFJbRGxsAg/0Be8qXDaCSXZzvs5n6bZBBR5rBgsRmqg4LErpFVtH3iKjIfadGQkbqesz/wZZr3QJTz4m3+niZlk6i1Agpx8ilCGai/db0s0viHQDbCLnh6DV/cbsa+2YQ3YzZYpFVEZthzPDSBiag3PxMYmqqah1rfB9vochd+OL4Nvy6ramcy3nK1cmArF4faFjW2yFCHEv4XN2OZ9YKlJV8UEFCu5Gs8kHvucxDwdfI7KOJ1vZ3NS12pU tMTWIaw0 gSp8W15jkubjhqF3yG3qdxuUKgS+JI8+OU6hJijMaRBT3tpyAUTFywcLCVSO5qlF9QGT145EHBY9IaBY2xyvl5czVET3jVPUDh4Fo0Gg78SJWTE7MyK1CXICV3PGglui5z/qx1oVh9Hf/8N00N1tlIVwrFioazbSPeBhBABTJkBSkYH8pdcQZ+VKMgQT/c8p0Pukz5NB66YHDwln7LbIoRfcSeQ== 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: List-Subscribe: List-Unsubscribe: Hello, On Thu, Jun 05, 2025 at 08:31:56AM -0400, Johannes Weiner wrote: > On Wed, Jun 04, 2025 at 08:19:28AM -0400, Johannes Weiner wrote: > > On Fri, May 30, 2025 at 12:31:35PM +0200, Vlastimil Babka wrote: ... > > > I've just read the previous threads about Barry's proposal and if doing this > > > always isn't feasible, I'm wondering if memcg would be a better interface to > > > opt-in for this kind of behavior than both prctl or mctl. I think at least > > > conceptually it fits what memcg is doing? The question is if the > > > implementation would be feasible, and if android puts apps in separate memcgs... > > > > CCing Tejun. > > > > Cgroups has been trying to resist flag settings like these. The cgroup > > tree is a nested hierarchical structure designed for dividing up > > system resources. But flag properties don't have natural inheritance > > rules. What does it mean if the parent group says one thing and the > > child says another? Which one has precedence? > > > > Hence the proposal to make it a per-process property that propagates > > through fork() and exec(). This also enables the container usecase (by > > setting the flag in the container launching process), without there > > being any confusion what the *effective* setting for any given process > > in the system is. +1. If something can work as something which gets inherited through the process hierarchy, that's usually the better choice than making it a cgroup property. There isn't much to be gained by making them cgroup properties especially given that cgroup hierarchy, in most systems at this point, is a degenerated process hierarchy. Thanks. -- tejun