From: Andrea Righi <arighi@nvidia.com>
To: Tejun Heo <tj@kernel.org>
Cc: David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev
Subject: Re: [PATCH sched_ext/for-6.18-fixes] sched_ext: Sync error_irq_work before freeing scx_sched
Date: Fri, 10 Oct 2025 08:31:49 +0200 [thread overview]
Message-ID: <aOioVT5imc8YSOJb@gpd4> (raw)
In-Reply-To: <20251009235623.4135746-1-tj@kernel.org>
On Thu, Oct 09, 2025 at 01:56:23PM -1000, Tejun Heo wrote:
> By the time scx_sched_free_rcu_work() runs, the scx_sched is no longer
> reachable. However, a previously queued error_irq_work may still be pending or
> running. Ensure it completes before proceeding with teardown.
>
> Fixes: bff3b5aec1b7 ("sched_ext: Move disable machinery into scx_sched")
> Signed-off-by: Tejun Heo <tj@kernel.org>
Good catch.
Acked-by: Andrea Righi <arighi@nvidia.com>
Thanks,
-Andrea
> ---
> kernel/sched/ext.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
> index XXXXXXXX..XXXXXXXX 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -3471,7 +3471,9 @@ static void scx_sched_free_rcu_work(struct rcu_work *rwork)
> struct scx_dispatch_q *dsq;
> int node;
>
> + irq_work_sync(&sch->error_irq_work);
> kthread_stop(sch->helper->task);
> +
> free_percpu(sch->pcpu);
>
> for_each_node_state(node, N_POSSIBLE)
> --
> 2.48.0
next prev parent reply other threads:[~2025-10-10 6:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 23:56 [PATCH sched_ext/for-6.18-fixes] sched_ext: Sync error_irq_work before freeing scx_sched Tejun Heo
2025-10-10 6:31 ` Andrea Righi [this message]
2025-10-13 18:33 ` 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=aOioVT5imc8YSOJb@gpd4 \
--to=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=void@manifault.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