From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753478AbcLLQaX (ORCPT ); Mon, 12 Dec 2016 11:30:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:48567 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753183AbcLLQaV (ORCPT ); Mon, 12 Dec 2016 11:30:21 -0500 Date: Mon, 12 Dec 2016 17:30:18 +0100 From: Petr Mladek To: Sergey Senozhatsky Cc: 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: <20161212163018.GE2441@pathway.suse.cz> References: <20161201135546.15549-1-sergey.senozhatsky@gmail.com> <20161201135546.15549-7-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161201135546.15549-7-sergey.senozhatsky@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Best Regards, Petr