diff options
author | Guilherme G. Piccoli <gpiccoli@canonical.com> | 2020-07-07 18:31:42 +0000 |
---|---|---|
committer | Guilherme G. Piccoli <gpiccoli@canonical.com> | 2020-08-04 17:10:52 -0300 |
commit | 189faca0c43b74f4b6c4dee4bcd4c5d6cee44aeb (patch) | |
tree | f5599b5ff1a9f1d1986cc7f400204d49d5c89d88 /extension_eppic.h | |
parent | 79fa90100eaf6c0e336753f34abaf4292739dfb2 (diff) |
kdump-tools: Add sysctl override mechanism
Currently users have no way to override sysctls on kdump environment,
which is specially harmful for machines with hugepages set via sysctls.
In this particular case, kdump may fail due to portions of memory getting
statically allocated as hugepages, risking kdump kernel boot then to be
impaired by the lack of usable memory.
This patch adds a sysctl overriding mechanism in the kdump environment.
It's based on the way init system apply the sysctls, *after* initramfs
stages, and by a specific filename-based precedece. So, this patch
hijacks this precedence order, by creating a higher precedence file on
/run temporary filesystem, with the desired overrides. For that, we use
an initramfs script, and managed to include it only in the kdump smaller
initrds, not on default system initrds (with some caveats, see [0]).
The patch aims to not break kdump if something wrong occur with the
sysctl override mechanism, the goal being to be the least invasive for
the regular system boot as possible. I'd like to thanks specially Thadeu
Cascardo for the prolific discussions about sysctl filename precedence
and the importance of using the right locale when sorting the filenames.
[0] NOTICE that, for Debian, this commit requires the subsequent patch
below in order to work properly, due to a limitation on initramfs-tools:
"kdump-tools: Cope with the lack of initramfs-tools OPTION=VAR
feature in Debian"
Signed-off-by: Guilherme G. Piccoli <gpiccoli@canonical.com>
Diffstat (limited to 'extension_eppic.h')
0 files changed, 0 insertions, 0 deletions