From: Tejun Heo <tj@kernel.org>
To: Aboorva Devarajan <aboorvad@linux.ibm.com>
Cc: peterz@infradead.org, void@manifault.com,
vincent.guittot@linaro.org, juri.lelli@redhat.com,
mingo@redhat.com, bsegall@google.com, rostedt@goodmis.org,
dietmar.eggemann@arm.com, vschneid@redhat.com, mgorman@suse.de,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: Pass correct scheduling policy to __setscheduler_class
Date: Fri, 25 Oct 2024 09:28:07 -1000 [thread overview]
Message-ID: <ZxvxR32TQ1UIVLtS@slm.duckdns.org> (raw)
In-Reply-To: <20241025185020.277143-1-aboorvad@linux.ibm.com>
On Sat, Oct 26, 2024 at 12:20:20AM +0530, Aboorva Devarajan wrote:
> The function __setscheduler_class determines the appropriate
> sched_class based on the scheduling policy and priority. Previously,
> the function used the task's pointer to retrieve the scheduling policy,
> which could lead to incorrect decisions if the task's struct had an
> outdated policy. This behaviour where the task pointer may reference an
> outdated policy when __setscheduler_class is called, was introduced in
> commit 98442f0ccd82 ("sched: Fix delayed_dequeue vs switched_from_fair()")
>
> To resolve this, corresponding scheduling policy is passed directly
> to __setscheduler_class instead of relying on the task pointer's cached
> policy. This ensures that the correct policy is always used when
> determining the scheduling class.
>
> -------------------------------------------------------
> Before Patch:
> -------------------------------------------------------
>
> ```
> sched_ext # ./runner -t init_enable_count
> ===== START =====
> TEST: init_enable_count
> DESCRIPTION: Verify we do the correct amount of counting of init,
> enable, etc callbacks.
> OUTPUT:
> ERR: init_enable_count.c:132
> Expected skel->bss->enable_cnt == num_children (3 == 5)
> not ok 1 init_enable_count #
> ===== END =====
>
> =============================
>
> RESULTS:
>
> PASSED: 0
> SKIPPED: 0
> FAILED: 1
> ```
> -------------------------------------------------------
> After Patch:
> -------------------------------------------------------
>
> ```
> sched-ext # ./runner -t init_enable_count
> ===== START =====
> TEST: init_enable_count
> DESCRIPTION: Verify we do the correct amount of counting of init,
> enable, etc callbacks.
> OUTPUT:
> ok 1 init_enable_count #
> ===== END =====
>
> =============================
>
> RESULTS:
>
> PASSED: 1
> SKIPPED: 0
> FAILED: 0
> ```
>
> Fixes: 98442f0ccd82 ("sched: Fix delayed_dequeue vs switched_from_fair()")
> Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
Acked-by: Tejun Heo <tj@kernel.org>
Peter, do you want me to route this patch or would tip be better?
Thanks.
--
tejun
next prev parent reply other threads:[~2024-10-25 19:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 18:50 Aboorva Devarajan
2024-10-25 19:28 ` Tejun Heo [this message]
2024-10-26 6:52 ` Peter Zijlstra
2024-10-26 7:18 ` Peter Zijlstra
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=ZxvxR32TQ1UIVLtS@slm.duckdns.org \
--to=tj@kernel.org \
--cc=aboorvad@linux.ibm.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=void@manifault.com \
--cc=vschneid@redhat.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®