Linux-HyperV Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 0/4] hv_utils: Add the support of hibernation
@ 2020-01-13  6:29 Dexuan Cui
  2020-01-13 22:21 ` Dexuan Cui
  0 siblings, 1 reply; 2+ messages in thread
From: Dexuan Cui @ 2020-01-13  6:29 UTC (permalink / raw)
  To: KY Srinivasan, Haiyang Zhang, Stephen Hemminger, sashal,
	Sasha Levin, linux-hyperv, Michael Kelley, vkuznets,
	linux-kernel

Hi,
This is an updated version of the v1 patchset:
https://lkml.org/lkml/2019/9/11/861

Patch #1 is a new patch that makes the daemons more robust.

Patch #2 is the same as v1.

Patch #3 sends the host-initiated hibernation request to the user space via udev.
(v1 used call_usermodehelper() and "/sbin/hyperv-hibernate".)

Patch #4 handles fcopy/vss specially to avoid possible inconsistent states.

Please review.

Thanks!

Dexuan Cui (4):
  Patch #1: Tools: hv: Reopen the devices if read() or write() returns errors
  Patch #2: hv_utils: Support host-initiated restart request
  Patch #3: hv_utils: Support host-initiated hibernation request
  Patch #4: hv_utils: Add the support of hibernation

 drivers/hv/hv_fcopy.c      |  58 +++++++++++++++-
 drivers/hv/hv_kvp.c        |  44 +++++++++++-
 drivers/hv/hv_snapshot.c   |  60 ++++++++++++++++-
 drivers/hv/hv_util.c       | 133 ++++++++++++++++++++++++++++++++++++-
 drivers/hv/hyperv_vmbus.h  |   6 ++
 include/linux/hyperv.h     |   2 +
 tools/hv/hv_fcopy_daemon.c |  19 ++++--
 tools/hv/hv_kvp_daemon.c   |  25 ++++---
 tools/hv/hv_vss_daemon.c   |  25 +++++--
 9 files changed, 344 insertions(+), 28 deletions(-)

-- 
2.19.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH v2 0/4] hv_utils: Add the support of hibernation
  2020-01-13  6:29 [PATCH v2 0/4] hv_utils: Add the support of hibernation Dexuan Cui
@ 2020-01-13 22:21 ` Dexuan Cui
  0 siblings, 0 replies; 2+ messages in thread
From: Dexuan Cui @ 2020-01-13 22:21 UTC (permalink / raw)
  To: KY Srinivasan, Haiyang Zhang, Stephen Hemminger, sashal,
	Sasha Levin, linux-hyperv, Michael Kelley, vkuznets,
	linux-kernel

> From: Dexuan Cui
> Sent: Sunday, January 12, 2020 10:29 PM
> 
> Hi,
> This is an updated version of the v1 patchset:
> https://lkml.org/lkml/2019/9/11/861
> 
> Patch #1 is a new patch that makes the daemons more robust.
> 
> Patch #2 is the same as v1.
> 
> Patch #3 sends the host-initiated hibernation request to the user space via
> udev.
> (v1 used call_usermodehelper() and "/sbin/hyperv-hibernate".)
> 
> Patch #4 handles fcopy/vss specially to avoid possible inconsistent states.
> 
> Please review.
> 
> Thanks!
> 
> Dexuan Cui (4):
>   Patch #1: Tools: hv: Reopen the devices if read() or write() returns errors
>   Patch #2: hv_utils: Support host-initiated restart request
>   Patch #3: hv_utils: Support host-initiated hibernation request
>   Patch #4: hv_utils: Add the support of hibernation

Hi Vitaly,
I forgot to mention this for patch #4: IMO we don't need to add a new
HVUTIL_SUSPENDED state to the hvutil state machine, because:

When we reach util_suspend(), all the userspace processes have been
frozen: see kernel/power/hibernate.c: hibernate() -> freeze_processes() ->
try_to_freeze_tasks(true) -> freeze_task() -> fake_signal_wake_up(). When
try_to_freeze_tasks(true) returns 0, all the user-space processes must be 
frozen in do_signal() -> get_signal() -> try_to_freeze() -> ... -> __refrigerator().

hibernate () -> hibernation_snapshot () -> dpm_suspend() -> ... -> 
util_suspend() only runs after hibernate() -> freeze_processes(), so I'm
pretty sure we have no race condition with the user space daemon.

util_suspend() -> srv->util_pre_suspend() disables the tasklet and cancels any
pening work items, so there is no race in the kernel space, either.

Thanks,
-- Dexuan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13  6:29 [PATCH v2 0/4] hv_utils: Add the support of hibernation Dexuan Cui
2020-01-13 22:21 ` Dexuan Cui

Linux-HyperV Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hyperv/0 linux-hyperv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hyperv linux-hyperv/ https://lore.kernel.org/linux-hyperv \
		linux-hyperv@vger.kernel.org
	public-inbox-index linux-hyperv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hyperv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git