public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Honglei Wang <jameshongleiwang@126.com>
Cc: tj@kernel.org, void@manifault.com, changwoo@igalia.com,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] sched_ext: switch class when preempted by higher priority scheduler
Date: Wed, 8 Jan 2025 10:05:32 +0100	[thread overview]
Message-ID: <Z34_3FSZwj0E1aUC@gpd3> (raw)
In-Reply-To: <20250108023328.37675-1-jameshongleiwang@126.com>

Hi Honglei,

On Wed, Jan 08, 2025 at 10:33:28AM +0800, Honglei Wang wrote:
> ops.cpu_release() function, if defined, must be invoked when preempted by
> a higher priority scheduler class task. This scenario was skipped in
> commit f422316d7466 ("sched_ext: Remove switch_class_scx()"). Let's fix
> it.
> 
> Fixes: f422316d7466 ("sched_ext: Remove switch_class_scx()")
> Signed-off-by: Honglei Wang <jameshongleiwang@126.com>

Thanks a lot for catching this, I've also reproduced a stall (due to the
missing ops.cpu_release() invocation) and verified that your fixes resolve
the problem, so:

Acked-by: Andrea Righi <arighi@nvidia.com>

> ---
>  kernel/sched/ext.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index 19d2699cf638..ef0e3f2c1e6f 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -3034,7 +3034,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
>  		 */
>  		if (p->scx.slice && !scx_rq_bypassing(rq)) {
>  			dispatch_enqueue(&rq->scx.local_dsq, p, SCX_ENQ_HEAD);
> -			return;
> +			goto switch_class;
>  		}
>  
>  		/*
> @@ -3051,6 +3051,7 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
>  		}
>  	}
>  
> +switch_class:
>  	if (next && next->sched_class != &ext_sched_class)
>  		switch_class(rq, next);
>  }
> -- 
> 2.45.2
> 

-Andrea

  reply	other threads:[~2025-01-08  9:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08  2:33 [PATCH v2] sched_ext: switch class when preempted by higher priority scheduler Honglei Wang
2025-01-08  9:05 ` Andrea Righi [this message]
2025-01-08 11:00   ` Honglei Wang
2025-01-08 16:46 ` 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=Z34_3FSZwj0E1aUC@gpd3 \
    --to=arighi@nvidia.com \
    --cc=bsegall@google.com \
    --cc=changwoo@igalia.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=jameshongleiwang@126.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=tj@kernel.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