From: Hongyan Xia <hongyan.xia2@arm.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] sched/ext: Add BPF functions for uclamp inc and dec
Date: Wed, 3 Jul 2024 20:49:51 +0100 [thread overview]
Message-ID: <11cf1fb4-2f8b-4bcb-a270-c698afbcd20e@arm.com> (raw)
In-Reply-To: <ZoWVKQ7sD5uz66w5@slm.duckdns.org>
On 03/07/2024 19:15, Tejun Heo wrote:
> Hello.
>
> On Wed, Jul 03, 2024 at 11:07:48AM +0100, Hongyan Xia wrote:
>> +__bpf_kfunc void scx_bpf_uclamp_rq_inc(s32 cpu, struct task_struct *p)
>> +{
>> + uclamp_rq_inc(cpu_rq(cpu), p);
>> +}
>> +
>> +__bpf_kfunc void scx_bpf_uclamp_rq_dec(s32 cpu, struct task_struct *p)
>> +{
>> + uclamp_rq_dec(cpu_rq(cpu), p);
>> +}
>
> So, I don't think we can expose these functions directly to the BPF
> scheduler. The BPF schedulers shouldn't be able to break system integrity no
> matter what they do and with the above it'd be trivial to get the bucket
> counters unbalanced, right?
You are right.
Actually, avoiding double enqueue or dequeue is easy and might be just a
one-line change. The real concern is when the BPF scheduler somehow
still has tasks on uclamp buckets when it's unloaded. Then, unloading
the scheduler needs to do uclamp_dec().
I'll see what I can do.
next prev parent reply other threads:[~2024-07-03 19:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 10:07 [PATCH 0/2] Move uclamp to each sched_class Hongyan Xia
2024-07-03 10:07 ` [PATCH 1/2] sched/uclamp: Delegate " Hongyan Xia
2024-07-03 18:13 ` Tejun Heo
2024-07-03 10:07 ` [PATCH 2/2] sched/ext: Add BPF functions for uclamp inc and dec Hongyan Xia
2024-07-03 18:15 ` Tejun Heo
2024-07-03 19:49 ` Hongyan Xia [this message]
2024-07-03 18:13 ` [PATCH 0/2] Move uclamp to each sched_class Tejun Heo
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=11cf1fb4-2f8b-4bcb-a270-c698afbcd20e@arm.com \
--to=hongyan.xia2@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/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