lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtDTs2btXekkhcSw3vNy3bR-S7+FY69Cb0AQEhK+RsQMZg@mail.gmail.com>
Date: Fri, 21 Feb 2025 12:48:55 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Abel Wu <wuyun.abel@...edance.com>
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>, 
	Juri Lelli <juri.lelli@...hat.com>, Dietmar Eggemann <dietmar.eggemann@....com>, 
	Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>, 
	Valentin Schneider <vschneid@...hat.com>, Josh Don <joshdon@...gle.com>, 
	Tianchen Ding <dtcccc@...ux.alibaba.com>, 
	"open list:SCHEDULER" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] sched/fair: Do not let idle entities preempt others

On Fri, 21 Feb 2025 at 12:12, Abel Wu <wuyun.abel@...edance.com> wrote:
>
> A task with SCHED_IDLE policy doesn't preempt others by definition, and
> the semantics are intended to be preserved when extending to cgroups
> introduced in commit 304000390f88 ("sched: Cgroup SCHED_IDLE support").
>
> But current implementation allows idle entities to preempt each other
> on wakeup, which seems not behave as expected especially after
> commit faa42d29419d ("sched/fair: Make SCHED_IDLE entity be preempted in strict hierarchy")
> so fix this by explicitly skip wakeup preemption for idle entities.
>
> Fixes: 304000390f88 ("sched: Cgroup SCHED_IDLE support")
> Signed-off-by: Abel Wu <wuyun.abel@...edance.com>
> ---
>  kernel/sched/fair.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 1c0ef435a7aa..4340178f29b7 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8778,12 +8778,15 @@ static void check_preempt_wakeup_fair(struct rq *rq, struct task_struct *p, int
>         pse_is_idle = se_is_idle(pse);
>
>         /*
> -        * Preempt an idle entity in favor of a non-idle entity (and don't preempt
> -        * in the inverse case).
> +        * Preempt an idle entity in favor of a non-idle entity.
>          */
>         if (cse_is_idle && !pse_is_idle)
>                 goto preempt;
> -       if (cse_is_idle != pse_is_idle)
> +
> +       /*
> +        * IDLE entities do not preempt others.
> +        */
> +       if (unlikely(pse_is_idle))
>                 return;

Fair enough

Reviewed-by: Vincent Guittot <vincent.guittot@...aro.org>

>
>         /*

> --
> 2.37.3
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ