From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752091AbcADPaR (ORCPT ); Mon, 4 Jan 2016 10:30:17 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34821 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751344AbcADPaM (ORCPT ); Mon, 4 Jan 2016 10:30:12 -0500 Date: Tue, 5 Jan 2016 00:28:32 +0900 From: Sergey Senozhatsky To: Andrew Morton Cc: Jan Kara , Petr Mladek , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Sergey Senozhatsky Subject: Re: [PATCH] printk: add cpu number to the recursion_msg message Message-ID: <20160104152832.GA3115@swordfish> References: <1451920294-1201-1-git-send-email-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1451920294-1201-1-git-send-email-sergey.senozhatsky@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (01/05/16 00:11), Sergey Senozhatsky wrote: > `recursion_bug' occupies 4 bytes to just tell us there was a recent > recursion bug (basically 'bool'). Make it a bit more informative and > keep in `recursion_bug' smp_processor_id of the CPU (the most recent > one) that has caused a recursive printk bug. For instance, the error > message will change from > BUG: recent printk recursion! > to > BUG: recent printk recursion on CPU5! > on the other hand -- no, this is silly. disregard, sorry. It's just my setup that confused me. but I think we can change `recursion_bug' type to `bool'. what do you think? ===8<===8<=== >>From d772453988289efc3bae5598c3c12c6e7ffb801a Mon Sep 17 00:00:00 2001 From: Sergey Senozhatsky Date: Tue, 5 Jan 2016 00:21:17 +0900 Subject: [PATCH] printk: change recursion_bug type to bool `recursion_bug' is used as recursion_bug toggle, so make it `bool'. Signed-off-by: Sergey Senozhatsky --- kernel/printk/printk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 1fc89ba..d0b8697 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -1662,7 +1662,7 @@ asmlinkage int vprintk_emit(int facility, int level, const char *dict, size_t dictlen, const char *fmt, va_list args) { - static int recursion_bug; + static bool recursion_bug; static char textbuf[LOG_LINE_MAX]; char *text = textbuf; size_t text_len = 0; @@ -1699,7 +1699,7 @@ asmlinkage int vprintk_emit(int facility, int level, * it can be printed at the next appropriate moment: */ if (!oops_in_progress && !lockdep_recursing(current)) { - recursion_bug = 1; + recursion_bug = true; local_irq_restore(flags); return 0; } @@ -1714,7 +1714,7 @@ asmlinkage int vprintk_emit(int facility, int level, static const char recursion_msg[] = "BUG: recent printk recursion!"; - recursion_bug = 0; + recursion_bug = false; /* emit KERN_CRIT message */ printed_len += log_store(0, 2, LOG_PREFIX|LOG_NEWLINE, 0, NULL, 0, recursion_msg, -- 2.7.0.rc0.20.g4b9ab0e