Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936358AbcJWNYq (ORCPT ); Sun, 23 Oct 2016 09:24:46 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:32820 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932406AbcJWNYo (ORCPT ); Sun, 23 Oct 2016 09:24:44 -0400 Date: Sun, 23 Oct 2016 22:23:43 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Jason Wessel , Daniel Thompson , Peter Zijlstra , Andrew Morton , Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] kdb: Call vkdb_printf() from vprintk_default() only when wanted Message-ID: <20161023132343.GA466@swordfish> References: <1477054235-1624-1-git-send-email-pmladek@suse.com> <1477054235-1624-3-git-send-email-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477054235-1624-3-git-send-email-pmladek@suse.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 637 Lines: 21 On (10/21/16 14:50), Petr Mladek wrote: [..] > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index d5e397315473..db73e33811e7 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -1941,7 +1941,9 @@ int vprintk_default(const char *fmt, va_list args) > int r; > > #ifdef CONFIG_KGDB_KDB > - if (unlikely(kdb_trap_printk)) { > + /* Allow to pass printk() to kdb but avoid a recursion. */ > + if (unlikely(kdb_trap_printk && > + kdb_printf_cpu != smp_processor_id())) { ^^^^^ aren't we are in preemptible here? -ss > r = vkdb_printf(KDB_MSGSRC_PRINTK, fmt, args); > return r;