On Fri, Jun 18, 2021 at 06:42:51AM +0000, HAGIO KAZUHITO(萩尾 一仁) wrote:
-----Original Message-----
> crash warns that ELF dump is incomplete like this:
>
> WARNING: vmcore: may be truncated or incomplete
> PT_LOAD p_offset: 218960740
> p_filesz: 4194304
> bytes required: 223155044
> dumpfile size: 219960740
>
> The warning saves a lot of time when figuring out what went wrong, but
> crash misses explicit dump detection for compressed kdumps.
>
> The change adds the warning for compressed kdumps:
>
> WARNING: vmcore: may be truncated or incomplete
> data_offset: 262144
> block_size: 65536
> total_valid_pages: 2438
> first_empty_pd: 100
> bytes required: 157467661
> dumpfile size: 265982
>
> bytes required is computed as:
>
> data_offset (kdump header + bitmaps)
> +
> total_valid_pages * page descriptor size (page descriptors)
> +
> zero page (that immediately follows page descriptors)
> +
> compressed size of every present page in the list of valid pages
> +
> block_size for every incomplete page (i.e page descriptor has
> zero offset)
hmm, this will be good for debugging, but the "bytes required" will not
match with the size of the complete dump at all if it's compressed, and
it will also be confusing.
Hi Kazu,
bytes required is computed using compressed size for each page by going
through the valid page descriptors. It should be quite accurate. I
tested it on the complete and incomplete dumps - handmade and from the
field. With the patch crash clearly reports that a dump is incomplete if
it's incomplete. I haven't seen any false-positives on the complete
cores.
But you're right that "bytes required" may not match size of complete
dump. Complete core might be a bit smaller because some page descriptors
may be missing in the incomplete core and we don't know what's
compressed page size that are referenced by the descriptors.
On the other side, netdump's meaning of bytes required is also not
exactly accurate so it's not different from what's provided in the
patch.
I can update both netdump and diskdump to report "estimated bytes
required" instead of "bytes required" to make it clear that it's only
estimation. Would that work for you?
So, I would prefer the number of valid page descriptors rather than
the "bytes required" and "dumpfile size". What do you think?
The number of valid discriptors is first_empty_pd - 1.
I honestly think we should print an estimation of the required bytes to
make crash friendly towards the engineers who don't know
crash/makedumpfile internals :)
Thanks,
Roman
The other patches look good to me.
Thanks,
Kazu