From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 771CF375F7C for ; Wed, 27 May 2026 19:24:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779909891; cv=none; b=mAeoJnFofB2LXGkiH0Avza6r1kXm3v6gBjk0zUlI1X16o4PfSuQK8ufS2xzifM8laSXKVv5xTIU5WfwqNWgQtEvuQXcfTMkRwxYlYD4OMm8qXjYGIMhMY5II1rubI6zVvSrSHhWAJlRSLWgJTVQmcmZi9OngiV36v1aqWHOSW1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779909891; c=relaxed/simple; bh=mzs44V0ArbnYBSYqYru0X0RfodIS3L65rWnUOMD05e4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oukc4JSAc6ceEX63/qdDlY3usXzFH1tga/QpEl35h0PpU7odPSYPe0fSKv7FVr+9KfucXrd+YPbodlAy6r84rkpc82sy+1P3fhEq41J0UIVv5TaCFBCkIMdf8ilb/fCq1D3FpFqzjELR0Kc1gJs7axHm5WFVjCA4tR9/Wj6bm9g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MPYCA7Br; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MPYCA7Br" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFF711F000E9; Wed, 27 May 2026 19:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779909890; bh=SnOgFDavYqT5hs3pjOIzagmJvnVe8mBnuumWJ7RCN+A=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=MPYCA7BrjzEn902WhzOyrepRrKNWTrrIo3xIE+lwZiwzsjACLePx4pIS+pT1SL5aF 6paJLW87XtstZAwTPDcUtAqZ9U8M5tT1fmhVcOatk2brpU3RPK+8yuBTCMj2oFNChZ ekAqd3RpF2Lai9e1ymQLTCIe9Mx9eUrhtSYGr37xqgCX/tzFf3dZBHMSez7lZwoxCv QqoPl/+0VpKLw5/uk2htu9TuzhAK6l+uNhk5SecvPg/MMGoYCBDmZbK4+XevPVKqbI p00mndpzEUkZh51h4Ia+BMcmfaoI/UYKpOyVxWJaiNLFkVyawFaTlcSEreVm9R1lBk zPI9KyVipog1g== Date: Wed, 27 May 2026 09:24:49 -1000 From: Tejun Heo To: Fernand Sieber Cc: David Vernet , Andrea Righi , Changwoo Min , Ingo Molnar , Peter Zijlstra , Vincent Guittot , linux-kernel@vger.kernel.org, nh-open-source@amazon.com, Fahad Mubeen , Hendrik Borghorst , David Woodhouse Subject: Re: [PATCH] sched/ext: add scx_bpf_cgroup_report_throttled kfunc Message-ID: References: <20260525192432.20487-1-sieberf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20260525192432.20487-1-sieberf@amazon.com> Hello, On Mon, May 25, 2026 at 09:24:32PM +0200, Fernand Sieber wrote: > +__bpf_kfunc void scx_bpf_cgroup_report_throttled(struct cgroup *cgrp, > + u64 throttled_ns) > +{ > +#ifdef CONFIG_CFS_BANDWIDTH > + struct task_group *tg; > + > + rcu_read_lock(); > + tg = cgrp->subsys[cpu_cgrp_id] ? > + container_of(cgrp->subsys[cpu_cgrp_id], struct task_group, css) : > + NULL; > + if (tg) { > + struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth; > + > + raw_spin_lock_irq(&cfs_b->lock); > + cfs_b->throttled_time += throttled_ns; > + cfs_b->nr_throttled++; > + cfs_b->nr_periods++; > + raw_spin_unlock_irq(&cfs_b->lock); > + } > + rcu_read_unlock(); > +#endif I don't think modifying fair's internal state from scx is a good idea. All the cgroup piping is split at the interface level. I think it'd be better to make both cfs and scx report their own numbers and then sum them up in the output. Thanks. -- tejun