Hi Vivek,
On Fri, May 27, 2022 at 8:56 PM Vivek Goyal vgoyal@redhat.com wrote:
On Fri, May 27, 2022 at 02:45:12PM +0800, Tao Liu wrote:
Thin provision is a mechanism that you can allocate a lvm volume which has a large virtual size for file systems but actually in a small physical size. The physical size can be autoextended in use if thin pool reached a threshold specified in /etc/lvm/lvm.conf.
So what's the core requirement? Is it about that root filesystem of the machine is on a thin device and after crash we are trying to save dump to rootfs.
Typically rootfs might have been setup for auto-extension. But problem here is that you are dumping the core from initrafsm context and auto extension might not work out of the box? So you are basically trying to pack dmeventd systemd unit file into initramfs and /etc/lvm/lvm.conf in initramfs to make auto extension work.
This patch set enables the feature that kdump to a lvm2 thinp volume. If the target is thinp volume, then the case of thinp pool autoextension should be considered. For thinp volume, it reports to have 1G space for its file system within, but it only allocated 100M physical space from thinp pool for example. As data is written in, more physical space is needed by thinp volume, thus thinp pool must be able to autoextend to provide more physical space to thinp volume. The autoextend threshold is defined in lvm.conf, and it is achieved by a monitor service defined in a dmeventd systemd unit file.
So lvm.conf and the systemd unit file should be packed into the initramfs image, for the use of lvm thinp during kdump. The requirement above is generic, it doesn't matter if the rootfs we are dumping to is on a thinp volume.
Thanks, Tao Liu
Vivek
There are 2 works should be handled when enable lvm2 thinp for kdump:
- Check if the dump target device or directory is thinp device.
- Monitor the thin pool and autoextend its size when it reached the threshold during kdump.
According to my testing, the memory consumption procedure for lvm2 thinp is the thin pool size-autoextend phase. For fedora and rhel9, the default crashkernel value is enough. But for rhel8, the default crashkernel value 1G-4G:160M is not enough, so it should be handled particularly.
v1 -> v2:
- Modified the usage of lvs cmd when check if target is lvm2 thinp device.
- Removed the sync flag way of mounting for lvm2 thinp target during kdump, use "sync -f vmcore" to force sync data, and handle the error if fails.
v2 -> v3:
- Removed "sync -f vmcore" patch out of the patch set, for it is
addressing an issue which is not specifically to lvm2 thinp support for kdump.
Tao Liu (3): Add lvm2 thin provision dump target checker Add lvm2-monitor.service for kdump when lvm2 thinp enabled lvm.conf should be check modified if lvm2 thinp enabled
dracut-lvm2-monitor.service | 15 +++++++++++++++ dracut-module-setup.sh | 16 ++++++++++++++++ kdump-lib-initramfs.sh | 20 ++++++++++++++++++++ kdumpctl | 1 + kexec-tools.spec | 2 ++ 5 files changed, 54 insertions(+) create mode 100644 dracut-lvm2-monitor.service
-- 2.33.1