Re: [RFC][PATCH] Replace a function call chain of kmsg_dump(KMSG_DUMP_KEXEC)with static function calls

From: AmÃrico Wang
Date: Wed Jul 13 2011 - 04:37:22 EST


2011/7/11 Seiji Aguchi <seiji.aguchi@xxxxxxx>:
> Hi,
>

Hi,

>
> [Patch Description]
>
> ÂFor meeting Eric/Vivek's requirements and solving issues of pstore/efivars driver, ÂI propose a following patch.
>
> Â Â- Remove kmsg_dump(KMSG_DUMP_KEXEC) from crash_kexec()

It is already removed in -mm, can you rebase your patch against -mm?

> Â Â- Add kmsg_dump_kexec() to crash_kexec()
> Â Â Â Âkmsg_dump_kexec() moved behind machine_crash_shutdown() so that
> Â Â Â Âwe can output kernel messages without getting any locks.
>
> Â Â- Introduce CONFIG_KMSG_DUMP_KEXEC
> Â Â Â Â- CONFIG_KMSG_DUMP_KEXEC depends on CONFIG_PRINTK which is required for kmsg_dumper.
>
> Â Â Â Â- CONFIG_KMSG_DUMP_KEXEC=n (default)
> Â Â Â Â ÂKernel message logging feature doesn't work in kdump path.
>
> Â Â Â Â- CONFIG_KMSG_DUMP_KEXEC=y
> Â Â Â Â Âfollowing static functions are called in kdump path.
> Â Â Â Â Â- kmsg_dump_kexec(): This is based on kmsg_dump() and just removed spinlock and a function call chain from it.
> Â Â Â Â Â- do_kmsg_dump_kexec(): This is based on pstore_dump() and just removed mutex lock from it.
>
> Â Â Â ÂSome people who are not familiar with kexec may add function calls getting spin_lock/mutex_lock in kexec path.
> Â Â Â ÂThese function calls causes failure of kexec.
> Â Â Â ÂSo, I suggest replace a call chain with static function calls so that we can keep reliability of kexec.
>
> Â Â - Add efi_kmsg_dump_kexec() which outputs kernel messages into NVRAM with EFI.
> Â Â Â This is called by do_kmsg_dump_kexec() statically.
> Â Â Â By applying to Matthew Garret's patch below, its kernel messages in NVRAM are visible through /dev/pstore.

This looks weird, kmsg_dump_kexec() calls do_kmsg_dump_kexec()
which then calls efi_kmsg_dump_kexec(), so, why not just call
efi_kmsg_dump_kexec()?
since there is no other user of kmsg_dump_kexec().

>From the name CONFIG_KMSG_DUMP_KEXEC, you seem to provide a generic method,
but actually only efi_kmsg_dump_kexec() is and can be called.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/