From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Scott Wood <swood@redhat.com>
Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH RT 1/2] sched: migrate_enable: Use per-cpu cpu_stop_work
Date: Mon, 3 Feb 2020 18:37:32 +0100 [thread overview]
Message-ID: <20200203173732.ldbgbpwao7xm23mm@linutronix.de> (raw)
In-Reply-To: <1579864307-13093-1-git-send-email-swood@redhat.com>
On 2020-01-24 06:11:46 [-0500], Scott Wood wrote:
> Commit e6c287b1512d ("sched: migrate_enable: Use stop_one_cpu_nowait()")
> adds a busy wait to deal with an edge case where the migrated thread
> can resume running on another CPU before the stopper has consumed
> cpu_stop_work. However, this is done with preemption disabled and can
> potentially lead to deadlock.
>
> While it is not guaranteed that the cpu_stop_work will be consumed before
> the migrating thread resumes and exits the stack frame, it is guaranteed
> that nothing other than the stopper can run on the old cpu between the
> migrating thread scheduling out and the cpu_stop_work being consumed.
> Thus, we can store cpu_stop_work in per-cpu data without it being
> reused too early.
>
> Fixes: e6c287b1512d ("sched: migrate_enable: Use stop_one_cpu_nowait()")
> Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Scott Wood <swood@redhat.com>
Yes, perfect, thank you.
Sebastian
prev parent reply other threads:[~2020-02-03 17:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 11:11 [PATCH RT 1/2] sched: migrate_enable: Use per-cpu cpu_stop_work Scott Wood
2020-01-24 11:11 ` [PATCH RT 2/2] sched: migrate_enable: Remove __schedule() call Scott Wood
2020-01-24 15:38 ` [PATCH RT 1/2] sched: migrate_enable: Use per-cpu cpu_stop_work Steven Rostedt
2020-02-03 17:37 ` Sebastian Andrzej Siewior [this message]
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=20200203173732.ldbgbpwao7xm23mm@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=swood@redhat.com \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).