From: peterz@infradead.org
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: mingo@kernel.org, vincent.guittot@linaro.org, tglx@linutronix.de,
linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bristot@redhat.com, swood@redhat.com
Subject: Re: [PATCH 1/2] sched: Fix balance_callback()
Date: Fri, 11 Sep 2020 14:25:47 +0200 [thread overview]
Message-ID: <20200911122547.GI1362448@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <jhjsgbo5wzl.mognet@arm.com>
On Fri, Sep 11, 2020 at 01:17:02PM +0100, Valentin Schneider wrote:
> On 11/09/20 09:17, Peter Zijlstra wrote:
> > The intent of balance_callback() has always been to delay executing
> > balancing operations until the end of the current rq->lock section.
> > This is because balance operations must often drop rq->lock, and that
> > isn't safe in general.
> >
> > However, as noted by Scott, there were a few holes in that scheme;
> > balance_callback() was called after rq->lock was dropped, which means
> > another CPU can interleave and touch the callback list.
> >
>
> So that can be say __schedule() tail racing with some setprio; what's the
> worst that can (currently) happen here? Something like say two consecutive
> enqueuing of push_rt_tasks() to the callback list?
Yeah, but that isn't in fact the case I worry most about.
What can happen (and what I've spotted once before) is that someone
attempts to enqueue a balance_callback from a rq->lock region that
doesn't handle the calls.
Currently that 'works', that is, it will get ran _eventually_. But
ideally we'd want that to not work and issue a WARN. We want the
callbacks to be timely.
So basically all of these machinations we in order to add the WARN :-)
next prev parent reply other threads:[~2020-09-11 17:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-11 8:17 [PATCH 0/2] sched: migrate_disable() preparations Peter Zijlstra
2020-09-11 8:17 ` [PATCH 1/2] sched: Fix balance_callback() Peter Zijlstra
2020-09-11 12:17 ` Valentin Schneider
2020-09-11 12:25 ` peterz [this message]
2020-09-11 13:27 ` Valentin Schneider
2020-09-11 8:17 ` [PATCH 2/2] sched/hotplug: Ensure only per-cpu kthreads run during hotplug Peter Zijlstra
2020-09-11 12:17 ` Valentin Schneider
2020-09-11 12:29 ` peterz
2020-09-11 13:48 ` Valentin Schneider
2020-09-16 10:18 ` Sebastian Andrzej Siewior
2020-09-16 12:10 ` peterz
2020-09-16 13:58 ` Sebastian Andrzej Siewior
2020-09-16 14:07 ` peterz
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=20200911122547.GI1362448@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bristot@redhat.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=swood@redhat.com \
--cc=tglx@linutronix.de \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.org \
/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
all inboxes | Powered by JetHome®