[PATCH] makedumpfile: change the wrong code to calculate bufsize_cyclic for elf dump
Atsushi Kumagai
kumagai-atsushi at mxc.nes.nec.co.jp
Fri May 23 00:18:01 PDT 2014
Hello Bao,
>Hi Astushi,
>
>> No, 16MB was used for bitmaps also in my case.
>> --cyclic-buffer option means specifying each bitmap size, so allocated bitmap
>> size is the double of --cyclic-buffer.
>> (But now, this behavior is only for ELF case, just the specified size is allocated
>> in kdump case. Yes, it's confusing...)
>>
>> --cyclic-buffer buffer_size
>> Specify the buffer size in kilo bytes for analysis in the cyclic
>> mode. Actually, the double of buffer_size kilo bytes will be
>> allocated in memory. In the cyclic mode, the number of cycles
>> is represented as:
>
>
>Yeah, I was wrong about this. If specified --cyclic-buffer doesn't
>exceed the memory limit, it is equal to info->bufsize_cyclic. But for
>elf dump, it need be double. E.g if free memory is 30M, --cyclic-buffer
>is 16M, it will absolutely fail. But the code check here should be done
>separately. Since it's meaningless for elf dump if 2 x --cyclic-buffer
>exceeds the free memory.
>
> if (info->bufsize_cyclic > free_memory) {
> .......
> {
>
>I think code here need be changed.
Exactly, this is a bug.
I can fix it simply by modification to the check above, but I think it's
better to change the ELF path to get rid of the 1st bitmap buffer since it's
unused. Then the required buffer size will be just <--cyclic-buffer> in both
cases, so I'll post the patch to do it later.
Thanks
Atsushi Kumagai
More information about the kexec
mailing list