On 04/29/16 at 02:50pm, Pratyush Anand wrote:
Hi Xunlei,
Thanks for the review
On Fri, Apr 29, 2016 at 2:04 PM, Xunlei Pang <xpang(a)redhat.com> wrote:
> On 2016/04/29 at 15:57, Pratyush Anand wrote:
>> Currently initramfs is rebuilt even when crash kernel memory is not
>> available and then latter on kdump service is failed.
>>
>> Its better to fail during feasibility itself when crash memory is not
>> reserved.
>>
>> Signed-off-by: Pratyush Anand <panand(a)redhat.com>
>> ---
>> kdumpctl | 25 ++++++++++++++++++-------
>> 1 file changed, 18 insertions(+), 7 deletions(-)
>>
>> diff --git a/kdumpctl b/kdumpctl
>> index c7abaafdda27..38f29d2a305d 100755
>> --- a/kdumpctl
>> +++ b/kdumpctl
>> @@ -545,13 +545,6 @@ need_64bit_headers()
>> # as the currently running kernel.
>> load_kdump()
>> {
>> - MEM_RESERVED=$(cat /sys/kernel/kexec_crash_size)
>> - if [ $MEM_RESERVED -eq 0 ]
>> - then
>> - echo "No memory reserved for crash kernel." >&2
>> - return 1
>> - fi
>> -
>> ARCH=`uname -m`
>> if [ "$ARCH" == "i686" -o "$ARCH" ==
"i386" ]
>> then
>> @@ -876,8 +869,26 @@ check_fence_kdump_config()
>> return 0
>> }
>>
>> +is_crash_mem_reserved()
>> +{
>> + MEM_RESERVED=$(cat /sys/kernel/kexec_crash_size)
>> + if [ $MEM_RESERVED -eq 0 ]
>> + then
>> + echo "No memory reserved for crash kernel." >&2
>> + return 0
>> + fi
>> +
>> + return 1
>> +}
>> +
>> +
>> check_dump_feasibility()
>> {
>> + is_crash_mem_reserved
>> + if [ $? -eq 0 ];then
>> + return 1
>> + fi
>> +
>
> I don't know if fadump needs reserved memory like kdump?
I am also not sure, but it looks like that fadump also uses same
memory reservation model. Documentation says: "Fadump uses the same
firmware interfaces and memory reservation model as phyp assisted
dump."
phyp assisten dump is not kdump, it is another firmware assisted dump
in powerpc. I think fadump does not need check crash_mem.
We need it only in check_kdump_feasibility, Ccing Hari anyway.
Thanks
Dave