Re: [PATCH 2/2] x86 mce: use new printk recursion disabling interface

From: ShuoX Liu
Date: Sun May 27 2012 - 22:10:28 EST


On 2012å05æ25æ 15:41, Borislav Petkov wrote:

> On Fri, May 25, 2012 at 03:21:12PM +0800, ShuoX Liu wrote:
>> From: ShuoX Liu <shuox.liu@xxxxxxxxx>
>>
>> Disable printk recursion to make sure MCE logs printed out.
>>
>> Signed-off-by: Yanmin Zhang <yanmin_zhang@xxxxxxxxxxxxxxx>
>> Signed-off-by: ShuoX Liu <shuox.liu@xxxxxxxxx>
>> ---
>> arch/x86/kernel/cpu/mcheck/mce.c | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
>> index 2afcbd2..365c35d 100644
>> --- a/arch/x86/kernel/cpu/mcheck/mce.c
>> +++ b/arch/x86/kernel/cpu/mcheck/mce.c
>> @@ -1015,6 +1015,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
>> DECLARE_BITMAP(toclear, MAX_NR_BANKS);
>> char *msg = "Unknown";
>>
>> + printk_recursion_check_disable();
>> atomic_inc(&mce_entry);
>>
>> this_cpu_inc(mce_exception_count);
>> @@ -1144,6 +1145,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
>> mce_wrmsrl(MSR_IA32_MCG_STATUS, 0);
>> out:
>> atomic_dec(&mce_entry);
>> + printk_recursion_check_enable();
>
> Looks like those should be at the beginning and the end of print_mce() -
> do_machine_check() could exit without printing an MCE and disabling the
> recursion check then is superfluous, methinks.

Boris,
I checked code and found some other functions in do_machine_check() also
would printk something. Such as add_taint(). So i think we'd better
place the recursion check at the beginning and the end of
do_machine_check(). Also more printks later(maybe) added will benefit
from this. Do you agree?

>
> 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/