linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mike Galbraith <efault@gmx.de>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Andy Lutomirski <luto@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Tejun Heo <tj@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] sched/cpuset/pm: Fix cpuset vs suspend-resume
Date: Thu, 7 Sep 2017 11:26:16 +0200	[thread overview]
Message-ID: <20170907092616.thsuyqklit4463wj@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20170907091338.orwxrqkbfkki3c24@hirez.programming.kicks-ass.net>

On Thu, Sep 07, 2017 at 11:13:38AM +0200, Peter Zijlstra wrote:
> Subject: sched/cpuset/pm: Fix cpuset vs suspend-resume
> 
> Cpusets vs suspend-resume is _completely_ broken. And it got noticed
> because it now resulted in non-cpuset usage breaking too.
> 
> On suspend cpuset_cpu_inactive() doesn't call into
> cpuset_update_active_cpus() because it doesn't want to move tasks about,
> there is no need, all tasks are frozen and won't run again until after
> we've resumed everything.
> 
> But this means that when we finally do call into
> cpuset_update_active_cpus() after resuming the last frozen cpu in
> cpuset_cpu_active(), the top_cpuset will not have any difference with
> the cpu_active_mask and this it will not in fact do _anything_.
> 
> So the cpuset configuration will not be restored. This was largely
> hidden because we would unconditionally create identity domains and
> mobile users would not in fact use cpusets much. And servers what do use
> cpusets tend to not suspend-resume much.
> 
> An addition problem is that we'd not in fact wait for the cpuset work to
> finish before resuming the tasks, allowing spurious migrations outside
> of the specified domains.
> 
> Fix the rebuild by introducing cpuset_force_rebuild() and fix the
> ordering with cpuset_wait_for_hotplug().
> 
> Cc: tj@kernel.org
> Cc: rjw@rjwysocki.net
> Cc: efault@gmx.de
> Reported-by: Andy Lutomirski <luto@kernel.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

TJ, I _think_ it was commit:

  deb7aa308ea2 ("cpuset: reorganize CPU / memory hotplug handling")

That wrecked things, but there's been so much changes in this area it is
really hard to tell. Note how before that commit it would
unconditionally rebuild the domains, and you 'optimized' that ;-)

That commit also introduced the work to do the async rebuild and failed
to do that flush on resume.

In any case, I think we should put a fixes tag on this commit such that
it gets picked up into stable kernels. Not sure anybody will try and
backport it into 4 year old kernels, but who knows.

  reply	other threads:[~2017-09-07  9:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06  5:13 Abysmal scheduler performance in Linus' tree? Andy Lutomirski
2017-09-06  8:25 ` Peter Zijlstra
2017-09-06  8:59   ` Andy Lutomirski
2017-09-06  9:03     ` Peter Zijlstra
2017-09-06 16:14       ` Peter Zijlstra
2017-09-07  6:15         ` Mike Galbraith
2017-09-07  7:31           ` Ingo Molnar
2017-09-07  9:13           ` [PATCH] sched/cpuset/pm: Fix cpuset vs suspend-resume Peter Zijlstra
2017-09-07  9:26             ` Peter Zijlstra [this message]
2017-09-07 10:54               ` Rafael J. Wysocki
2017-09-07 20:38               ` Tejun Heo
2017-09-07 10:33             ` [tip:sched/urgent] sched/cpuset/pm: Fix cpuset vs. suspend-resume bugs tip-bot for Peter Zijlstra
2017-09-06  9:15 ` Abysmal scheduler performance in Linus' tree? Chris Wilson
2017-09-06  9:24   ` Peter Zijlstra
     [not found]     ` <150469312649.28581.17626550155735691534@mail.alporthouse.com>
2017-09-06 10:44       ` Peter Zijlstra
2017-09-06 10:51         ` Peter Zijlstra
2017-09-07  8:16           ` [tip:sched/urgent] sched/fair: Fix wake_affine_llc() balancing rules tip-bot for Peter Zijlstra

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=20170907092616.thsuyqklit4463wj@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.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;
as well as URLs for NNTP newsgroup(s).