[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZxvxR32TQ1UIVLtS@slm.duckdns.org>
Date: Fri, 25 Oct 2024 09:28:07 -1000
From: Tejun Heo <tj@...nel.org>
To: Aboorva Devarajan <aboorvad@...ux.ibm.com>
Cc: peterz@...radead.org, void@...ifault.com, vincent.guittot@...aro.org,
juri.lelli@...hat.com, mingo@...hat.com, bsegall@...gle.com,
rostedt@...dmis.org, dietmar.eggemann@....com, vschneid@...hat.com,
mgorman@...e.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched: Pass correct scheduling policy to
__setscheduler_class
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@...ux.ibm.com>
Acked-by: Tejun Heo <tj@...nel.org>
Peter, do you want me to route this patch or would tip be better?
Thanks.
--
tejun
Powered by blists - more mailing lists