From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753594AbcCRIXw (ORCPT ); Fri, 18 Mar 2016 04:23:52 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:49208 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753232AbcCRIXl (ORCPT ); Fri, 18 Mar 2016 04:23:41 -0400 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.220.139 X-Original-MAILFROM: byungchul.park@lge.com From: "byungchul.park" To: "'Sergey Senozhatsky'" Cc: "'Sergey Senozhatsky'" , "'Jan Kara'" , "'Andrew Morton'" , "'Jan Kara'" , "'Petr Mladek'" , "'Tejun Heo'" , "'Tetsuo Handa'" , References: <1457964820-4642-2-git-send-email-sergey.senozhatsky@gmail.com> <20160315100323.GF17942@quack.suse.cz> <20160315140738.GA773@swordfish> <20160316053944.GJ5220@X58A-UD3R> <20160316065851.GC3217@swordfish> <20160316073007.GL5220@X58A-UD3R> <20160316075605.GE3217@swordfish> <20160316103431.GM5220@X58A-UD3R> <20160317003450.GA538@swordfish> <20160318054913.GN5220@X58A-UD3R> <20160318071130.GA19655@swordfish> In-Reply-To: <20160318071130.GA19655@swordfish> Subject: RE: [RFC][PATCH v4 1/2] printk: Make printk() completely async Date: Fri, 18 Mar 2016 17:23:38 +0900 Message-ID: <002701d180ef$78bff480$6a3fdd80$@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQE9+HArtMFtgnYEIeus1O8w+bdbNgJWt5jmAOjEQpwBWnRO4QGvlu2qAhn+VCMBz8PBxAJ+/uoiAmguG58B/sVEBAD1LSf2n/Vw+lA= Content-Language: ko Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > [..] > > diff --git a/kernel/locking/spinlock_debug.c > b/kernel/locking/spinlock_debug.c > > index fd24588..30559c6 100644 > > --- a/kernel/locking/spinlock_debug.c > > +++ b/kernel/locking/spinlock_debug.c > > @@ -138,14 +138,25 @@ static void __spin_lock_debug(raw_spinlock_t *lock) > > { > > u64 i; > > u64 loops = loops_per_jiffy * HZ; > > + static raw_spinlock_t *suspected_lock = NULL; > > this has no chances to survive on SMP systems that have spin_lockup-ed on > at > least two different spin locks. I don't think so. It can have chances to survive on SMP with 2 different locks. Remind the condition this problem can happen. 1. when it is "lockup suspected". 2. when it is within a printk(). 2 different locks mean 2 different timing. Therefore it's important to prevent a recursion at a place trying to obtain the lock. After a lock is solved, the other lock can be solved step by step. > I'd really prefer not to mix-in spin_dump/printk recursion problems into > this I didn't mix-in it into this. I only focused your patch. Your approach introduces unnecessary losing a message which we don't want. But you worried about "infinite recursion" when implementing it without losing the message. That's why I am saying it doesn't need to be worried and there's another way, that is, my suggestion. > patch set. it makes sense not to make printk recursion detection worse due > to It makes more sense not to introduce newly added spin_locks. You are currently utilize the last resort for detecting recursion. It's too bad. Don't you think so? > newly added spin_locks to vprintk_emit(), but that's it. this patch set > set is > fixing other things in the first place. As I said, this patch's trying to fix a problem in your patch, which is introduced while discussing yours. Thanks, Byungchul