From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753339AbcLMB1B (ORCPT ); Mon, 12 Dec 2016 20:27:01 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35997 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752864AbcLMB1A (ORCPT ); Mon, 12 Dec 2016 20:27:00 -0500 Date: Tue, 13 Dec 2016 10:27:06 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Andrew Morton , Jan Kara , Tejun Heo , Calvin Owens , Thomas Gleixner , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Linus Torvalds , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC][PATCHv5 6/7] printk: use printk_safe buffers in printk Message-ID: <20161213012706.GD415@jagdpanzerIV.localdomain> References: <20161201135546.15549-1-sergey.senozhatsky@gmail.com> <20161201135546.15549-7-sergey.senozhatsky@gmail.com> <20161212163018.GE2441@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161212163018.GE2441@pathway.suse.cz> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (12/12/16 17:30), Petr Mladek wrote: > On Thu 2016-12-01 22:55:45, Sergey Senozhatsky wrote: > > Use printk_safe per-CPU buffers in printk recursion-prone blocks: > > -- around logbuf_lock protected sections in vprintk_emit() and > > console_unlock() > > -- around down_trylock_console_sem() and up_console_sem() > > > > Note that this solution addresses deadlocks caused by printk() > > recursive calls only. That is vprintk_emit() and console_unlock(). > > > > Another thing to note is that we now keep lockdep enabled in printk, > > because we are protected against the printk recursion caused by lockdep > > in vprintk_emit() by the printk-safe mechanism - we first switch to > > per-CPU buffers and only then access the deadlock-prone locks. > > > > Signed-off-by: Sergey Senozhatsky > > Looks fine and safe to me. > > Reviewed-by: Petr Mladek thanks. -ss