1
0
Fork 0
remarkable-linux/kernel/power
Peter Zijlstra ba15518c26 sched/cpuset/pm: Fix cpuset vs. suspend-resume bugs
commit 50e7663233 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: <stable@vger.kernel.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: deb7aa308e ("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: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-12 11:51:25 +02:00
..
Kconfig PM / sleep: Increase default DPM watchdog timeout to 120 2016-09-13 02:15:58 +02:00
Makefile PM / Hibernate: Don't let kasan instrument snapshot.c 2016-06-14 00:38:56 +02:00
autosleep.c PM / Sleep: avoid 'autosleep' in shutdown progress 2013-07-15 01:31:37 +02:00
console.c PM / sleep: Make pm_prepare_console() return void 2016-06-15 01:26:04 +02:00
hibernate.c PM / Hibernate: allow hibernation with PAGE_POISONING_ZERO 2016-09-13 02:35:27 +02:00
main.c PM / sleep: enable suspend-to-idle even without registered suspend_ops 2016-09-13 02:17:19 +02:00
power.h PM / Hibernate: allow hibernation with PAGE_POISONING_ZERO 2016-09-13 02:35:27 +02:00
poweroff.c power/sysrq: fix inconstistent help message of sysrq key 2013-04-30 17:04:10 -07:00
process.c sched/cpuset/pm: Fix cpuset vs. suspend-resume bugs 2017-10-12 11:51:25 +02:00
qos.c PM / QoS: avoid calling cancel_delayed_work_sync() during early boot 2016-09-05 15:07:53 +02:00
snapshot.c PM / Hibernate: allow hibernation with PAGE_POISONING_ZERO 2016-09-13 02:35:27 +02:00
suspend.c PM / suspend: Fix missing KERN_CONT for suspend message 2016-10-24 14:38:02 +02:00
suspend_test.c PM / sleep: fix device reference leak in test_suspend 2016-11-02 05:10:04 +01:00
swap.c Power management material for v4.8-rc1 2016-07-26 17:29:07 -07:00
user.c PM / sleep: make PM notifiers called symmetrically 2016-06-28 00:38:55 +02:00
wakelock.c PM / autosleep: Use workqueue for user space wakeup sources garbage collector 2015-07-14 21:04:48 +02:00