|
From: Seiji A. <sei...@hd...> - 2011-12-02 22:09:11
|
Hi, Discussion: As Don mentioned in following thread, it would be nice for pstore/kmsg_dump to serialize panic path because they can log messages reliably. https://lkml.org/lkml/2011/10/13/427 This patchset is based on his proposal switching smp_send_stop() from REBOOT_VECTOR to NMI. Change Log: v2 -> v3 - Skip spin_locks in panic case in both kmsg_dump() and pstore_dump() instead of calling spin_lock_init() to avoid potential issues due to spin_lock_init() - Add WARN_ON() in "in_nmi() and !panic" case into kmsg_dump() so that we trap when someone adds new kmsg_dump() in NMI path in the future - Skip subsequent kmsg_dump() function calls to avoid deadlock. v1 -> v2 - Add trylocks to kmsg_dump()/pstore_dump() so that they can work in NMI context. - Divide a patch into two First one is just moving kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop() Second one is changing lock operations in kmsg_dump()/pstore_dump() v1 - Move kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop - Bust logbuf_lock of kmsg_dump() in panic path for avoiding deadlock - Bust psinfo->buf_lock of pstore_dump() in panic path for avoiding deadlock Patch Description: [RFC][PATCH v3 1/3] Move kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop() - Just move kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop() [RFC][PATCH v3 2/3] Skip spin_locks in panic case and add WARN_ON() - Skip spin_locks in panic case in both kmsg_dump() and pstore_dump() - Add WARN_ON() in "in_nmi() and !panic" case into kmsg_dump() [RFC][PATCH v3 3/3] Skip subsequent kmsg_dump() - Skip subsequent kmsg_dump() function calls TODO: This patchset focuses on only kmsg_dump()/pstore_dump(). So, we have to check whether backend drivers work. Any comments are welcome. Seiji Aguchi (3): Move kmsg_dump(KMSG_DUMP_PANIC) below smp_send_stop() Skip spin_locks in panic case and add WARN_ON() Skip subsequent kmsg_dump() fs/pstore/platform.c | 16 ++++++---------- kernel/panic.c | 4 ++-- kernel/printk.c | 23 +++++++++++++++++++++-- 3 files changed, 29 insertions(+), 14 deletions(-) |