From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Scott Wood <swood@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-rt-users <linux-rt-users@vger.kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH RT] sched: migrate_enable: Busy loop until the migration request is completed
Date: Fri, 13 Dec 2019 09:14:28 +0100 [thread overview]
Message-ID: <20191213081428.mw6bqjg6m7djwhby@linutronix.de> (raw)
In-Reply-To: <30ab713901ef0e1f23c1ca387373788a4a73639f.camel@redhat.com>
On 2019-12-13 00:44:22 [-0600], Scott Wood wrote:
> > @@ -8239,7 +8239,10 @@ void migrate_enable(void)
> > stop_one_cpu_nowait(task_cpu(p), migration_cpu_stop,
> > &arg, &work);
> > __schedule(true);
> > - WARN_ON_ONCE(!arg.done && !work.disabled);
> > + if (!work.disabled) {
> > + while (!arg.done)
> > + cpu_relax();
> > + }
>
> We should enable preemption while spinning -- besides the general badness
> of spinning with it disabled, there could be deadlock scenarios if
> multiple CPUs are spinning in such a loop. Long term maybe have a way to
> dequeue the no-longer-needed work instead of waiting.
Hmm. My plan was to use per-CPU memory and spin before the request is
enqueued if the previous isn't done yet (which should not happen™).
Then we could remove __schedule() here and rely on preempt_enable()
doing that. With that change we wouldn't care about migrate-disable
level vs preempt-disable level and could drop the hacks we have in futex
code for instance (where we have an extra migrate_disable() in advance
so they are later balanced).
> -Scott
Sebastian
next prev parent reply other threads:[~2019-12-13 8:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 11:27 [PATCH RT] sched: migrate_enable: Busy loop until the migration request is completed Sebastian Andrzej Siewior
2019-12-13 6:44 ` Scott Wood
2019-12-13 8:14 ` Sebastian Andrzej Siewior [this message]
2020-01-22 21:13 ` Scott Wood
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=20191213081428.mw6bqjg6m7djwhby@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).