]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
sched/cpuset/pm: Fix cpuset vs. suspend-resume bugs
authorPeter Zijlstra <peterz@infradead.org>
Thu, 7 Sep 2017 09:13:38 +0000 (11:13 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 28 Sep 2017 14:36:14 +0000 (10:36 -0400)
commitbcd6860a9c3d3ac4ecc927c2437fe77c541f4c1f
treeec8a3c4d83e5c56c58500006e20e1673fc88f2e6
parent6b676ff60d34ebcbd0ff4e64ed573ad1b51af2dc
sched/cpuset/pm: Fix cpuset vs. suspend-resume bugs

BugLink: http://bugs.launchpad.net/bugs/1720154
commit 50e76632339d4655859523a39249dd95ee5e93e7 upstream.

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().

Reported-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: deb7aa308ea2 ("cpuset: reorganize CPU / memory hotplug handling")
Link: http://lkml.kernel.org/r/20170907091338.orwxrqkbfkki3c24@hirez.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
include/linux/cpuset.h
kernel/cgroup/cpuset.c
kernel/power/process.c
kernel/sched/core.c