[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#40927] [PATCH] Allow resume from swap device during boot
From: |
Jean-Baptiste Note |
Subject: |
[bug#40927] [PATCH] Allow resume from swap device during boot |
Date: |
Tue, 05 May 2020 18:07:15 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hi Danny,
Thanks for being so guix in answering the original report.
Your questions prompted me to take a bit of time before answering.
Regarding attribution, i've dug two instances of this patch:
https://git.pantherx.org/mirror/guix/commit/af8d58efa05927b24694c87379cccc378f3fdde7
https://issues.guix.gnu.org/issue/37290
https://lists.gnu.org/archive/html/bug-guix/2019-09/msg00017.html
Both instances of the patch are given by author Mark H Weaver <address@hidden>
As you can see there's already an open issue in GUIX regarding resume;
i'm sorry i missed that. Maybe for attribution it would make sense for
me to resend the patch there; let me know how to proceed.
Regarding the patch itself and your questions:
- for comparison to the original patch: elogind currently has the
configurability required to make the second half of the original
patch moot, and I think it would be better to split the work
anyways;
- i've addressed the reference to swsusp.txt
- the resume argument is provided by (in my case) the system
definition, so I basically have something like that:
#+begin_src scheme
(operating-system
(kernel-arguments
(cons
(string-append "modprobe.blacklist="
(comma-separated
%redundant-linux-modules))
'("--resume=/dev/sdb3" "quiet"))))
#end_src
- in order to support this in the GUIX installer, I guess adding such
a line in the generated system definition, along with a swap
partition, would be sufficient. My knowledge of the workings of the
guix installer is null, tough :)
- please note that if you have a suspend signature on your swap
partition, and fail to resume from it (for instance because of a
missing kernel commandline argument...), then shepherd will fail
bringing up the swap device, and you will need to handle this
situation by hand currently;
- My knowledge of the details of swsusp is rather limited: I don't
know, for instance, how this would translate in case of a more
complex setup of multi-swap devices;
- However, it seems very clear from the documentation that a mere
resume= argument syntax can trigger specific initialization paths
within the kernel itself leading to a resume. I find it better
style, ultimately, to properly separate the responsibilities of
kernel and initrd, follow the GUIX conventions with a --resume
argument.
- therefore I propose the following, updated patch, with a more
GUIX-like --resume argument; I've tested it on my laptop, which
happens to have an encrypted /home partition (but only one swap
device).
- as far as I can understand the documentation, the swap partition
does not have to be as big as the RAM; by default the kernel will
strive to make the suspend image 2/5 of the physical RAM, but this
can be tuned more aggressively. There's actually less than overhead:
some parts of the memory can be discarded (shared MMAPd files, the
buffer cache); and even then you can hope compression will reduce
the needs. If the swap space is not large enough, suspend will
simply fail.
This probably raises more issues than it solves, however i'd rather you
have the whole picture. Let me know how to proceed; I'm willing to
follow-up with other patches to get the feature up to the required
standards of quality.
Kind regards,
Jean-Baptiste
0001-linux-boot-Add-support-for-resuming-from-swap-device.patch
Description: updated resume patch
signature.asc
Description: PGP signature