Enable configuring resume offset via sysfs

Bug #1760106 reported by Mario Limonciello
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
Critical
Unassigned
klibc (Ubuntu)
Fix Released
Undecided
Dimitri John Ledkov
Bionic
Incomplete
Undecided
Unassigned
Cosmic
Won't Fix
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Medium
Seth Forshee
Bionic
Fix Released
Medium
Seth Forshee
Cosmic
Fix Released
Medium
Seth Forshee
systemd (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned
Cosmic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * Cannot hibernate & resume from a swapfile

[Test Case]

 * Create or enlarge swapfile to be big enough for hibernation
 * Attempt to hibernate and resume

[Regression Potential]

 * Hibernation is not reliable technology in itself, and multiple things may cause failure to resume. Thus it is sufficient to validate this bug after swapfile is attempted for hibernation and the disk offset kernel parameter is modified. Irrespective if actual suspending or resume were successful or not.

[Other Info]

 * Original bug report

In 4.17 a new attribute is introduced to configure the hibernation resume offset. Since Ubuntu enables a swapfile by default this attribute is important to be able to make hibernation work "out of the box".

The patch in the kernel is here:
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=355064675f1c997cea017ea64c8f2c216e5425d9

Systemd support for adopting this change is available here:
https://github.com/systemd/systemd/pull/8406
As of 3/30/18 it's not yet been merged however.

Klibc support for adopting this change is available here:
https://www.zytor.com/pipermail/klibc/2018-March/003986.html

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1760106

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
description: updated
Changed in linux (Ubuntu):
importance: Undecided → Medium
tags: added: bionic kernel-da-key
Changed in linux (Ubuntu Bionic):
status: Confirmed → Triaged
summary: - Enable configuring resume offset via sysfs
+ FFe: Enable configuring resume offset via sysfs
Seth Forshee (sforshee)
Changed in linux (Ubuntu Bionic):
assignee: nobody → Seth Forshee (sforshee)
status: Triaged → Fix Committed
Revision history for this message
Andy Whitcroft (apw) wrote : Re: FFe: Enable configuring resume offset via sysfs

As this is 4.17 only I assume we will have to backport this for the kernel. Asking one of the kernel-team folk to review that. Also how close is pottering to accepting the systemd changes. As it seems we need all three bits ready.

Revision history for this message
Mario Limonciello (superm1) wrote :

@Andy,

The systemd changes are approved, just waiting for CI to pass and they'll be merged.

Revision history for this message
Mario Limonciello (superm1) wrote :

regarding klibc upstream is MIA for a long time. There are patches that have been posted before mine, but no activity since:

commit 4d19974d7020488f63651244e1f9f51727c3f66c
Author: H. Peter Anvin <email address hidden>
Date: Mon Feb 1 13:26:01 2016 -0800

    [klibc] fwrite: fix typo in comment

    Fix typo in comment, no code change.

    Reported-by: Gilles Espinasse <email address hidden>
    Signed-off-by: H. Peter Anvin <email address hidden>

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Please note, I'm not part of the release team.

Over the lifetime of bionic userspace it will be used on newer kernels, or those that backport this particular feature.

Despite this being a "new" interface, I see this as actually a minor bug and deficiency of Linux platform, given that other operating systems support swapfile hybernation just fine. Thus it's merely a bug fix. However, the value of knowing that "bionic GA and above" are fixed would be really nice. As far as I can tell, the linux kernel patch is in proposed already, and userspace should follow too. I'll look into cherrypicking that into systemd.

Revision history for this message
Mario Limonciello (superm1) wrote :

@xnox in order to coordinate the systemd upload in case you have anything in flight, here's a debdiff:

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (40.4 KiB)

This bug was fixed in the package linux - 4.15.0-15.16

---------------
linux (4.15.0-15.16) bionic; urgency=medium

  * linux: 4.15.0-15.16 -proposed tracker (LP: #1761177)

  * FFe: Enable configuring resume offset via sysfs (LP: #1760106)
    - PM / hibernate: Make passing hibernate offsets more friendly

  * /dev/bcache/by-uuid links not created after reboot (LP: #1729145)
    - SAUCE: (no-up) bcache: decouple emitting a cached_dev CHANGE uevent

  * Ubuntu18.04:POWER9:DD2.2 - Unable to start a KVM guest with default machine
    type(pseries-bionic) complaining "KVM implementation does not support
    Transactional Memory, try cap-htm=off" (kvm) (LP: #1752026)
    - powerpc: Use feature bit for RTC presence rather than timebase presence
    - powerpc: Book E: Remove unused CPU_FTR_L2CSR bit
    - powerpc: Free up CPU feature bits on 64-bit machines
    - powerpc: Add CPU feature bits for TM bug workarounds on POWER9 v2.2
    - powerpc/powernv: Provide a way to force a core into SMT4 mode
    - KVM: PPC: Book3S HV: Work around transactional memory bugs in POWER9
    - KVM: PPC: Book3S HV: Work around XER[SO] bug in fake suspend mode
    - KVM: PPC: Book3S HV: Work around TEXASR bug in fake suspend state

  * Important Kernel fixes to be backported for Power9 (kvm) (LP: #1758910)
    - powerpc/mm: Fixup tlbie vs store ordering issue on POWER9

  * Ubuntu 18.04 - IO Hang on some namespaces when running HTX with 16
    namespaces (Bolt / NVMe) (LP: #1757497)
    - powerpc/64s: Fix lost pending interrupt due to race causing lost update to
      irq_happened

  * fwts-efi-runtime-dkms 18.03.00-0ubuntu1: fwts-efi-runtime-dkms kernel module
    failed to build (LP: #1760876)
    - [Packaging] include the retpoline extractor in the headers

linux (4.15.0-14.15) bionic; urgency=medium

  * linux: 4.15.0-14.15 -proposed tracker (LP: #1760678)

  * [Bionic] mlx4 ETH - mlnx_qos failed when set some TC to vendor
    (LP: #1758662)
    - net/mlx4_en: Change default QoS settings

  * AT_BASE_PLATFORM in AUXV is absent on kernels available on Ubuntu 17.10
    (LP: #1759312)
    - powerpc/64s: Fix NULL AT_BASE_PLATFORM when using DT CPU features

  * Bionic update to 4.15.15 stable release (LP: #1760585)
    - net: dsa: Fix dsa_is_user_port() test inversion
    - openvswitch: meter: fix the incorrect calculation of max delta_t
    - qed: Fix MPA unalign flow in case header is split across two packets.
    - tcp: purge write queue upon aborting the connection
    - qed: Fix non TCP packets should be dropped on iWARP ll2 connection
    - sysfs: symlink: export sysfs_create_link_nowarn()
    - net: phy: relax error checking when creating sysfs link netdev->phydev
    - devlink: Remove redundant free on error path
    - macvlan: filter out unsupported feature flags
    - net: ipv6: keep sk status consistent after datagram connect failure
    - ipv6: old_dport should be a __be16 in __ip6_datagram_connect()
    - ipv6: sr: fix NULL pointer dereference when setting encap source address
    - ipv6: sr: fix scheduling in RCU when creating seg6 lwtunnel state
    - mlxsw: spectrum_buffers: Set a minimum quota for CPU port traffic
    - net: phy: Tell caller result ...

Changed in linux (Ubuntu Bionic):
status: Fix Committed → Fix Released
Changed in systemd (Ubuntu Cosmic):
status: New → In Progress
Changed in systemd (Ubuntu Bionic):
status: New → Confirmed
Changed in systemd (Ubuntu Cosmic):
status: In Progress → Fix Committed
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Mario, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in systemd (Ubuntu Bionic):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Dimitri John Ledkov (xnox) wrote : Re: FFe: Enable configuring resume offset via sysfs

Hm.... I think I am confused on how this feature is supposed to work.

I've increased the swapfile size to cover my RAM and then some. However, initramfs doesn't configure resume= nor resume_offset= thus after hibernation, resume is not at all attempted. Should I specify resume=/dev/vda1 or some such?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I think this is actually fine. Ship it.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Mario, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed verification-needed-bionic
removed: verification-done verification-done-bionic
Changed in oem-priority:
importance: Undecided → Critical
status: New → Triaged
Revision history for this message
Dimitri John Ledkov (xnox) wrote : Re: FFe: Enable configuring resume offset via sysfs

This patch set is still present, and is operating as expected in 237-3ubuntu10.2

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 237-3ubuntu10.2

---------------
systemd (237-3ubuntu10.2) bionic; urgency=medium

  * logind: backport v238/v239 fixes for handling DRM devices.
    These changes introduce all the fixes that correct handling of open fd's
    related to the DRM devices, as used by for example NVIDIA GPUs. This backport
    includes some refactoring, corrections, and comment updates. This to insure
    that correct history is preserved, code comments match reality, and to ease
    backporting logind fixes in the future SRUs. (LP: #1777099)
  * Disable dh_installinit generation of tmpfiles for the systemd package.
    Replace with a manual safe call to systemd-tmpfiles which will process any
    updates to the tmpfiles shipped by systemd package, taking into account any
    overrides shipped by other packages, sysadmin, or specified in the runtime
    directories. (LP: #1748147)

systemd (237-3ubuntu10.1) bionic; urgency=medium

  [ Dimitri John Ledkov ]
  * hwdb: Fix wlan/rfkill keycode on Dell systems. (LP: #1762385)
  * Cherrypick upstream fix for corrected detection of Virtualbox & Xen.
    (LP: #1768104)
  * Further improve captive portal workarounds.
    Retry any NXDOMAIN results with lower feature levels, instead of just those
    with 'secure' in the domain name. (LP: #1766969)

  [ Michael Biebl ]
  * Add dependencies of libsystemd-shared to Pre-Depends.
    This is necessary so systemctl is functional at all times during a
    dist-upgrade. (Closes: #897986) (LP: #1771791)

  [ Mario Limonciello ]
  * Fix hibernate disk offsets.
    Configure resume offset via sysfs, to enable resume from a swapfile.
    (LP: #1760106)

 -- Dimitri John Ledkov 🌈 <email address hidden> Fri, 22 Jun 2018 13:55:09 +0100

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote : Re: FFe: Enable configuring resume offset via sysfs

This bug was fixed in the package systemd - 239-7ubuntu4

---------------
systemd (239-7ubuntu4) cosmic; urgency=medium

  * Workaround broken meson copying symlinked data files, as dangling symlinks.

 -- Dimitri John Ledkov <email address hidden> Wed, 22 Aug 2018 14:11:35 +0100

Changed in systemd (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Revision history for this message
quanxian (quanxian-wang) wrote :

Has this fix built into daily live? Currently for server and client, we all come across this issues in 18.10.

Changed in oem-priority:
status: Triaged → Fix Released
Changed in klibc (Ubuntu Cosmic):
assignee: nobody → Dimitri John Ledkov (xnox)
tags: added: id-5bb77b984f77316caf8912cf
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

klibc ftbfs on i386 in disco.

Revision history for this message
Matthias Klose (doko) wrote :

removing, breaks amd64 autopkg tests.

Removing packages from disco-proposed:
 klibc 2.0.4-9ubuntu3 in disco
  klibc-utils 2.0.4-9ubuntu3 in disco amd64
  klibc-utils 2.0.4-9ubuntu3 in disco arm64
  klibc-utils 2.0.4-9ubuntu3 in disco armhf
  klibc-utils 2.0.4-9ubuntu3 in disco ppc64el
  klibc-utils 2.0.4-9ubuntu3 in disco s390x
  libklibc 2.0.4-9ubuntu3 in disco amd64
  libklibc 2.0.4-9ubuntu3 in disco arm64
  libklibc 2.0.4-9ubuntu3 in disco armhf
  libklibc 2.0.4-9ubuntu3 in disco ppc64el
  libklibc 2.0.4-9ubuntu3 in disco s390x
  libklibc-dev 2.0.4-9ubuntu3 in disco amd64
  libklibc-dev 2.0.4-9ubuntu3 in disco arm64
  libklibc-dev 2.0.4-9ubuntu3 in disco armhf
  libklibc-dev 2.0.4-9ubuntu3 in disco ppc64el
  libklibc-dev 2.0.4-9ubuntu3 in disco s390x
Comment: see LP: #1760106: remove klibc from proposed, breaking autopkg tests
1 package successfully removed.

Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... [ 2.742629] 220 (nuke): Uhuuh, elf segment at 0000000000200000 requested but the memory is mapped already
Segmentation fault
done.
[ 2.746818] 222 (run-init): Uhuuh, elf segment at 0000000000200000 requested but the memory is mapped already
Segmentation fault
Target filesystem doesn't have requested /sbin/init.
[ 2.750846] 223 (run-init): Uhuuh, elf segment at 0000000000200000 requested but the memory is mapped already
Segmentation fault
[ 2.753957] 224 (run-init): Uhuuh, elf segment at 0000000000200000 requested but the memory is mapped already
Segmentation fault
[ 2.757109] 225 (run-init): Uhuuh, elf segment at 0000000000200000 requested but the memory is mapped already
Segmentation fault
[ 2.760128] 226 (run-init): Uhuuh, elf segment at 0000000000200000 requested but the memory is mapped already
Segmentation fault
[ 2.763174] 227 (run-init): Uhuuh, elf segment at 0000000000200000 requested but the memory is mapped already
Segmentation fault
chvt: can't open console
No init found. Try passing init= bootarg.
Couldn't get a file descriptor referring to the console

BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu4) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) [6n
---------------------------------------------------
<VirtSubproc>: failure: Timed out on waiting for ssh connection
autopkgtest [09:21:38]: ERROR: testbed failure: cannot send to testbed: [Errno 32] Broken pipe

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@Mario

Instead of your patch, this one https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=a2f9cd4abe2d5cb72e1e89089b132e866e3cea81 got merged into klibc upstream and is now present in disco.

Changed in klibc (Ubuntu):
status: New → Fix Released
Changed in klibc (Ubuntu Cosmic):
assignee: Dimitri John Ledkov (xnox) → nobody
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Since this is no longer an FFe thing, I am removing so from the title. This should help fix our searches better. The ideal way would be to unsubscribe ubuntu-release, though.

summary: - FFe: Enable configuring resume offset via sysfs
+ Enable configuring resume offset via sysfs
tags: added: oem-priority
Revision history for this message
Julian Andres Klode (juliank) wrote :

Is there anything left to do here?

Changed in klibc (Ubuntu Bionic):
status: New → Incomplete
Changed in klibc (Ubuntu Cosmic):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.