From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C2782773F0; Wed, 29 Oct 2025 20:36:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761770201; cv=none; b=QvmnMQ6e5o5UnZxCFMB2wSEPJBncuBYr0ffTbwpLWre2XTSRnwoMRpIP9NagsMlM7XaUJ2boREPDXnp1u+5cVnf/vAD8ra6X8WY3rUpitjiLVizlmqrx/XZE1lMipqupJM7vj6PA8CTyOogiGUtEROg2Msb4Rl9sK38SZ2R5wZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761770201; c=relaxed/simple; bh=iOgHS+eZEE/s/+7/l6K7Sr/3V+3Pj70ijnv3Cvpoook=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gwTNo8Cu/OgZv6mCQo3VgmgqF4NFBjzYxlgxL1TbIwSTEfnWTXRBJoxtdvkorsQoSMU/EmrA3B4aEm/of9RJ5zPDiZLE+GHrv/+5ovKnAahwuQNTdXH4E9oShKturquOkHRV12uv5GmvcyA/pr6yy9AZLP8fkRDUdY1WW3fjCT4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DrC5gWSU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DrC5gWSU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E19A6C4CEF7; Wed, 29 Oct 2025 20:36:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761770201; bh=iOgHS+eZEE/s/+7/l6K7Sr/3V+3Pj70ijnv3Cvpoook=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DrC5gWSUJMcUvoYLDXbfHIwK1tb2VBfHwJxQHwh7TzSL5xh8sdvcpQx06xLCpGTzD 6QQbbuzI+A/83Qlo+5BQGNuXpAkQyO09qgmnhxbREexwqrM9/pbeWYilD3XQafjfXD HLxEIloCvEhH93/Qn0m2ZleVlXUNdrWWQldZwdOuIPMn2PXL+rj2ACGEwkcb3AhzfC 8VL8fzNYLHsdvEe95oaGzi6RelBNNgGhKSWy70B1SDCA6SFjt2zL0ax7ezldRCYICq v5gj8faxK3Pe1LhmNADlsWAcETHsfwvDKTaSu7gFesptWU5Y/ZMOVqtl5nwTqZCsqJ P7/gghhtBrsOw== Date: Wed, 29 Oct 2025 10:36:39 -1000 From: Tejun Heo To: Roman Gushchin Cc: Andrew Morton , linux-kernel@vger.kernel.org, Alexei Starovoitov , Suren Baghdasaryan , Michal Hocko , Shakeel Butt , Johannes Weiner , Andrii Nakryiko , JP Kobryn , linux-mm@kvack.org, cgroups@vger.kernel.org, bpf@vger.kernel.org, Martin KaFai Lau , Song Liu , Kumar Kartikeya Dwivedi Subject: Re: [PATCH v2 02/23] bpf: initial support for attaching struct ops to cgroups Message-ID: References: <20251027231727.472628-1-roman.gushchin@linux.dev> <20251027231727.472628-3-roman.gushchin@linux.dev> <87ldkte9pr.fsf@linux.dev> Precedence: bulk X-Mailing-List: cgroups@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ldkte9pr.fsf@linux.dev> On Wed, Oct 29, 2025 at 01:25:52PM -0700, Roman Gushchin wrote: > > BTW, for sched_ext sub-sched support, I'm just adding cgroup_id to > > struct_ops, which seems to work fine. It'd be nice to align on the same > > approach. What are the benefits of doing this through fd? > > Then you can attach a single struct ops to multiple cgroups (or Idk > sockets or processes or some other objects in the future). > And IMO it's just a more generic solution. I'm not very convinced that sharing a single struct_ops instance across multiple cgroups would be all that useful. If you map this to normal userspace programs, a given struct_ops instance is package of code and all the global data (maps). ie. it's not like running the same program multiple times against different targets. It's more akin to running a single program instance which can handle multiple targets. Maybe that's useful in some cases, but that program would have to explicitly distinguish the cgroups that it's attached to. I have a hard time imagining use cases where a single struct_ops has to service multiple disjoint cgroups in the hierarchy and it ends up stepping outside of the usual operation model of cgroups - commonality being expressed through the hierarchical structure. Thanks. -- tejun