From: Tejun Heo <tj@kernel.org>
To: Fernand Sieber <sieberf@amazon.com>
Cc: David Vernet <void@manifault.com>,
Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
linux-kernel@vger.kernel.org, nh-open-source@amazon.com,
Fahad Mubeen <fmubeen@amazon.de>,
Hendrik Borghorst <hborghor@amazon.de>,
David Woodhouse <dwmw@amazon.co.uk>
Subject: Re: [PATCH] sched/ext: add scx_bpf_cgroup_report_throttled kfunc
Date: Wed, 27 May 2026 09:24:49 -1000 [thread overview]
Message-ID: <ahdFAZVnb3DTv8Jo@slm.duckdns.org> (raw)
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
next prev parent reply other threads:[~2026-05-27 19:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 19:24 Fernand Sieber
2026-05-27 19:24 ` Tejun Heo [this message]
2026-05-28 10:43 ` kernel test robot
2026-05-30 0:29 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ahdFAZVnb3DTv8Jo@slm.duckdns.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=dwmw@amazon.co.uk \
--cc=fmubeen@amazon.de \
--cc=hborghor@amazon.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nh-open-source@amazon.com \
--cc=peterz@infradead.org \
--cc=sieberf@amazon.com \
--cc=vincent.guittot@linaro.org \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®