From: David Vernet <void@manifault.com>
To: Tejun Heo <tj@kernel.org>
Cc: Zhao Mengmeng <zhaomzhao@126.com>,
zhaomengmeng@kylinos.cn, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sched_ext: Replace hardcoding with macro and minor typo fix
Date: Thu, 14 Nov 2024 11:34:18 -0600 [thread overview]
Message-ID: <20241114173418.GA4643@maniforge> (raw)
In-Reply-To: <ZzYvf2L3rlmjuKzh@slm.duckdns.org>
[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]
On Thu, Nov 14, 2024 at 07:12:31AM -1000, Tejun Heo wrote:
> Hello,
>
> On Wed, Nov 13, 2024 at 10:59:08AM +0800, Zhao Mengmeng wrote:
> > From: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
> >
> > 1. replace hardcoding with SCX_KF_UNLOCKED.
> > 2. scx_next_task_picked() has been replaced with siwtch_class().
> > 3. minor typo fixes.
> >
> > Signed-off-by: Zhao Mengmeng <zhaomengmeng@kylinos.cn>
> > ---
> > kernel/sched/ext.c | 6 +++---
> > tools/sched_ext/scx_qmap.bpf.c | 2 +-
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> > index 1b1c33f12dd7..832f77d1d318 100644
> > --- a/kernel/sched/ext.c
> > +++ b/kernel/sched/ext.c
> > @@ -2759,10 +2759,10 @@ static int balance_one(struct rq *rq, struct task_struct *prev)
> > * If the previous sched_class for the current CPU was not SCX,
> > * notify the BPF scheduler that it again has control of the
> > * core. This callback complements ->cpu_release(), which is
> > - * emitted in scx_next_task_picked().
> > + * emitted in switch_class().
> > */
> > if (SCX_HAS_OP(cpu_acquire))
> > - SCX_CALL_OP(0, cpu_acquire, cpu_of(rq), NULL);
> > + SCX_CALL_OP(SCX_KF_UNLOCKED, cpu_acquire, cpu_of(rq), NULL);
>
> I think this is actually a bug. David, shouldn't this be SCX_KF_REST?
Yes, good catch. We're holding the rq lock so SCX_KF_UNLOCKED isn't safe. I
agree this should be SCX_KF_REST.
Thanks,
David
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-11-14 17:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 2:59 [PATCH v2] sched_ext: Replace hardcoding with macro and minor typo fix Zhao Mengmeng
2024-11-14 17:12 ` Tejun Heo
2024-11-14 17:34 ` David Vernet [this message]
2024-11-15 0:33 ` Zhao Mengmeng
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=20241114173418.GA4643@maniforge \
--to=void@manifault.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=zhaomengmeng@kylinos.cn \
--cc=zhaomzhao@126.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