From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754539AbcCNCjr (ORCPT ); Sun, 13 Mar 2016 22:39:47 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:33607 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754466AbcCNCjd (ORCPT ); Sun, 13 Mar 2016 22:39:33 -0400 Date: Mon, 14 Mar 2016 11:40:55 +0900 From: Sergey Senozhatsky To: Byungchul Park Cc: Sergey Senozhatsky , akpm@linux-foundation.org, mingo@kernel.org, linux-kernel@vger.kernel.org, akinobu.mita@gmail.com, jack@suse.cz, peter@hurleysoftware.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org Subject: Re: [PATCH v6 2/2] printk: Make printing of spin_dump() deferred to avoid a deadlock Message-ID: <20160314024054.GC8074@swordfish> References: <1457692627-14076-1-git-send-email-byungchul.park@lge.com> <1457692627-14076-3-git-send-email-byungchul.park@lge.com> <20160314013752.GB8074@swordfish> <20160314023030.GE5220@X58A-UD3R> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160314023030.GE5220@X58A-UD3R> 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 Hi, On (03/14/16 11:30), Byungchul Park wrote: [..] > > so can it be > > > > vprintk_emit() > > __spin_dump_deferred() > > vprintk_deferred() > > vprintk_emit() > > __spin_dump_deferred() > ^^^ > can be caused by raw_spin_lock(logbug_lock) > > > vprintk_deferred() > > Yes, it can happen by raw_spin_lock(logbuf_lock) to print warning or error > message. Are you worrying about an infinite recursion? yes. > 1. In the case printing warning, eventually it can fill the buffer without > actual printing using console. so the worry is that the CPU that spins on __spin_dump_deferred() has IRQs disabled and `printk_pending' bit set; but IRQ may never be enabled on this CPU. > 2. In the case printing error, the infinite recursion can be prevented by > debug_locks_off(). > > Therefore, no problem. -ss