HI Coiby and Philipp,
On Fri, Oct 28, 2022 at 9:51 AM Coiby Xu <coxu(a)redhat.com> wrote:
On Thu, Oct 27, 2022 at 02:54:25PM +0200, Philipp Rudo wrote:
>Hi Coiby,
>Hi Tao,
>
>On Wed, 26 Oct 2022 11:33:01 +0800
>Coiby Xu <coxu(a)redhat.com> wrote:
>
>> Hi Tao,
>>
>> On Sat, Oct 08, 2022 at 03:41:38PM +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.
>> >
>> >There are 2 works should be handled when enable lvm2 thinp for kdump:
>> >
>> >1) Check if the dump target device or directory is thinp device.
>>
>> Does dracut has the ability to automatically detect if a root filesystem
>> is lvm2 thinp? It seem dracut can build a ordinary initrd that switch
>> to a lvm volume root filesystem. If that's true, can we harness dracut
>> to it for us? If it works, I imagine NVMf-fc and infini-band may also
>> been supported automatically without us doing anything.
>
Currently dracut doesn't have the ability to detect a rootfs is lvm2
thinp. As for this patchset, it relies on kexec-tools to tell dracut
if volume is lvm2 thinp and autoextend monitor service is needed. I
agree it will be a nice feature if dracut can detect lvm2 thinp rootfs
and start an autoextend monitor service in background before switch to
it. It is a long term goal to me because currently I didn't see the
need to make a lvm thinp rootfs. Nowadays the rootfs can be small
enough, considering the embedded systems or the initramfs as we do in
2nd kernel of kdump. There won't be much benefit of a lvm thinp
rootfs. Anyway I think we can do the feature when we encounter the
actual use case.
Thanks,
Tao Liu
>that would be nice of course. However the way I see it it would
only
>make patch 3 obsolete. The rest of the series would need to stay the
>way it is.
Thanks for the reminding! Yeah, unless dracut also has the ability to
only update the initrd if truly necessary, we need patch 2 which depends
on patch 1. Basically, what I want to achieve is to avoid the need of
having some internal knowledge about lvm2 thin provision and only
need to make sure the observable behaviour is what we expect by adding
the test. But I imagine this would a long-term goal.
>
>Having this said, with the nit in the first patch fixed the series looks
>good to me.
>
>Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
>
>Thanks
>Philipp
>
>>
>> >2) 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:
>> >
>> >1) Modified the usage of lvs cmd when check if target is lvm2 thinp
>> > device.
>> >2) 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:
>> >
>> >1) 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.
>> >
>> >v3 -> v4:
>> >
>> >1) Removed lvm2-monitor.service, implemented the monitor service with
>> > a loop function within a shell script instead.
>> >2) Add lvm2 thinp support for dump_raw, for it is addressing the similar
>> > issue as dump_fs.
>> >3) Dave suggested me to implement the lvm2 thin support in dracut
>> > modules instead of kexec-tools. If you are OK with the
loop-function-shell-script
>> > technical way, I will give a try to migrate it to dracut.
>> >
>> >v4 -> v5:
>> >
>> >1) A new 80lvmthinpool-monitor module [1] has been integrated in dracut.
>> > Now we simply depend on it.
>> >2) Add lvm2 thin provision selftest.
>> >
>> >[1]:
https://github.com/dracutdevs/dracut/pull/1842
>> >
>> >v5 -> v6:
>> >
>> >1) Code refactoring based on Philipp's comments.
>> >2) Print warning if lvmthinpool-monitor module is not exist.
>> >
>> >Tao Liu (5):
>> > Add lvm2 thin provision dump target checker
>> > lvm.conf should be check modified if lvm2 thinp enabled
>> > Add dependency of dracut lvmthinpool-monitor module
>> > selftest: Only iterate the .sh files for test execution
>> > selftest: Add lvm2 thin provision for kdump test
>> >
>> > dracut-module-setup.sh | 8 +++
>> > kdump-lib-initramfs.sh | 10 ++++
>> > kdump-lib.sh | 6 ++
>> > kdumpctl | 1 +
>> > tests/scripts/run-test.sh | 3 +-
>> > .../lvm2-thinp-kdump/0-local-lvm2-thinp.sh | 59 +++++++++++++++++++
>> > .../testcases/lvm2-thinp-kdump/lvm.conf | 5 ++
>> > 7 files changed, 90 insertions(+), 2 deletions(-)
>> > create mode 100755
tests/scripts/testcases/lvm2-thinp-kdump/0-local-lvm2-thinp.sh
>> > create mode 100644 tests/scripts/testcases/lvm2-thinp-kdump/lvm.conf
>> >
>> >--
>> >2.33.1
>> >
>>
>
--
Best regards,
Coiby