From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D605FC49EAB for ; Fri, 25 Jun 2021 12:37:00 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22CE561921 for ; Fri, 25 Jun 2021 12:37:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22CE561921 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GBGj753tSz3c20 for ; Fri, 25 Jun 2021 22:36:59 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=OeYxvhga; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.com (client-ip=195.135.220.29; helo=smtp-out2.suse.de; envelope-from=pmladek@suse.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=OeYxvhga; dkim-atps=neutral Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GBGhZ40Bqz2yyx for ; Fri, 25 Jun 2021 22:36:29 +1000 (AEST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id EA2CB1FE8E; Fri, 25 Jun 2021 12:36:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1624624584; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7WwlFfjzZ1Gum+16nGRv3muCKcaRSIAsgxa6F7g7/oU=; b=OeYxvhgasMbs1C4iwauKBACmiNMDd0tSDrThewMZ6zKe8VPNyBLvZJimgJIfLDGStY1fqD cKyIFjs+gpxRK0TUi+Gke3O3gFGVIw0Rt1k/bWtzIqhFZubH0mQn+FRw5U5DcmjHyChpKo ktEb3ho5wyguj6B2R30GozD0getgIAM= Received: from suse.cz (unknown [10.100.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id B92B4A3BB4; Fri, 25 Jun 2021 12:36:23 +0000 (UTC) Date: Fri, 25 Jun 2021 14:36:23 +0200 From: Petr Mladek To: John Ogness Subject: Re: [PATCH printk v3 4/6] printk: remove NMI tracking Message-ID: References: <20210624111148.5190-1-john.ogness@linutronix.de> <20210624111148.5190-5-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210624111148.5190-5-john.ogness@linutronix.de> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Alexei Starovoitov , Chris Wilson , "Wolfram Sang \(Renesas\)" , Paul Mackerras , Marc Zyngier , Masahiro Yamada , Russell King , Ingo Molnar , linux-arm-kernel@lists.infradead.org, Sami Tolvanen , Valentin Schneider , Kees Cook , Anshuman Khandual , Frederic Weisbecker , Steven Rostedt , Nathan Chancellor , Nick Terrell , Thomas Gleixner , Vlastimil Babka , linux-kernel@vger.kernel.org, Pekka Enberg , Sergey Senozhatsky , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Mike Rapoport Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu 2021-06-24 13:17:46, John Ogness wrote: > All NMI contexts are handled the same as the safe context: store the > message and defer printing. There is no need to have special NMI > context tracking for this. Using in_nmi() is enough. > > Signed-off-by: John Ogness > Reviewed-by: Petr Mladek > --- > arch/arm/kernel/smp.c | 2 -- > arch/powerpc/kexec/crash.c | 3 --- > include/linux/hardirq.h | 2 -- > include/linux/printk.h | 12 ------------ > init/Kconfig | 5 ----- > kernel/printk/internal.h | 6 ------ > kernel/printk/printk_safe.c | 37 +------------------------------------ > kernel/trace/trace.c | 2 -- > 8 files changed, 1 insertion(+), 68 deletions(-) > > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c > index 74679240a9d8..0dd2d733ad62 100644 > --- a/arch/arm/kernel/smp.c > +++ b/arch/arm/kernel/smp.c > @@ -668,9 +668,7 @@ static void do_handle_IPI(int ipinr) > break; > > case IPI_CPU_BACKTRACE: > - printk_nmi_enter(); > nmi_cpu_backtrace(get_irq_regs()); > - printk_nmi_exit(); It looks to me that in_nmi() returns false here. As a result, nmi_cpu_backtrace() might newly call consoles immediately. If I recall correctly, arm does not have a proper NMI. And this is just some special case of a "normal" IRQ. And indeed, nmi_enter() is called only from handle_fiq_as_nmi() and it is just a boiler plate. If I am right, we should replace printk_nmi_enter() with printk_safe_enter_irqsave(flags) or so. Even better solution might be to call this within nmi_enter()/nmi_exit(). But I am not sure if this is what the arm people want. Best Regards, Petr PS: Sigh, I have skipped this patch yesterday because it already had my Reviewed-by. And I missed it before...