From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752229AbcA0BNO (ORCPT ); Tue, 26 Jan 2016 20:13:14 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:36811 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751165AbcA0BNL (ORCPT ); Tue, 26 Jan 2016 20:13:11 -0500 Subject: Re: [PATCH v2] lib/spinlock_debug.c: prevent an infinite recursive cycle in spin_dump() To: Andrew Morton , Byungchul Park References: <1453078692-15291-1-git-send-email-byungchul.park@lge.com> <20160126161124.cba2f003a4a21a6f11cf51a8@linux-foundation.org> Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, akinobu.mita@gmail.com, jack@suse.cz, torvalds@linux-foundation.org From: Peter Hurley Message-ID: <56A819A4.3080702@hurleysoftware.com> Date: Tue, 26 Jan 2016 17:13:08 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160126161124.cba2f003a4a21a6f11cf51a8@linux-foundation.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/26/2016 04:11 PM, Andrew Morton wrote: > On Mon, 18 Jan 2016 09:58:12 +0900 Byungchul Park wrote: > >> It causes an infinite recursive cycle when using CONFIG_DEBUG_SPINLOCK, >> in the spin_dump(). Backtrace prints printk() -> console_trylock() -> >> do_raw_spin_lock() -> spint_bug() -> spin_dump() -> printk()... >> infinitely. >> >> If the spin_bug() is called from a function like printk() which is >> trying to obtain the console lock, we should prevent the debug spinlock >> code from calling printk() again in that context. >> > > lol. Excellent. [...] > I can't immediately think of anything better than this. It's a hack, but > it's a small and quite clear hack. Andrew, I think you may have missed this follow-up from Byungchul: On 01/21/2016 12:12 AM, Byungchul Park wrote: > I was careless. I think it should be fixed by another way, instead of > the way this patch suggested. Regards, Peter Hurley