]> git.baikalelectronics.ru Git - kernel.git/commit
PM / Hibernate: Fix s2disk regression related to freezing workqueues
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 29 Jan 2012 19:35:52 +0000 (20:35 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Sun, 29 Jan 2012 19:35:52 +0000 (20:35 +0100)
commit8696991c687cc5ac7673ee323319bb28407b18b4
tree66e69f83b63e8517a47e0eb0e7ae730d8a9a109b
parent88d07552284da454158883fec81c933d74a5119a
PM / Hibernate: Fix s2disk regression related to freezing workqueues

Commit 41dfd8add3e12dc1ed1d0c8898c65142356a8f44

  PM / Hibernate: Freeze kernel threads after preallocating memory

introduced a mechanism by which kernel threads were frozen after
the preallocation of hibernate image memory to avoid problems with
frozen kernel threads not responding to memory freeing requests.
However, it overlooked the s2disk code path in which the
SNAPSHOT_CREATE_IMAGE ioctl was run directly after SNAPSHOT_FREE,
which caused freeze_workqueues_begin() to BUG(), because it saw
that worqueues had been already frozen.

Although in principle this issue might be addressed by removing
the relevant BUG_ON() from freeze_workqueues_begin(), that would
reintroduce the very problem that commit 41dfd8add3e12dc1ed1d0c8898c
attempted to avoid into that particular code path.  For this reason,
to fix the issue at hand, introduce thaw_kernel_threads() and make
the SNAPSHOT_FREE ioctl execute it.

Special thanks to Srivatsa S. Bhat for detailed analysis of the
problem.

Reported-and-tested-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: stable@kernel.org
include/linux/freezer.h
kernel/power/process.c
kernel/power/user.c