From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758484AbcLAFcp (ORCPT ); Thu, 1 Dec 2016 00:32:45 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35673 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810AbcLAFcn (ORCPT ); Thu, 1 Dec 2016 00:32:43 -0500 Date: Thu, 1 Dec 2016 14:32:47 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Andrew Morton , Jan Kara , Tejun Heo , Calvin Owens , Thomas Gleixner , Mel Gorman , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Laura Abbott , Andy Lutomirski , Linus Torvalds , Kees Cook , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC][PATCHv4 3/6] printk: introduce per-cpu safe_print seq buffer Message-ID: <20161201053247.GA7814@jagdpanzerIV> References: <20161027154933.1211-1-sergey.senozhatsky@gmail.com> <20161027154933.1211-4-sergey.senozhatsky@gmail.com> <20161124165821.GG24103@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161124165821.GG24103@pathway.suse.cz> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (11/24/16 17:58), Petr Mladek wrote: [..] > > +/* > > + * Lockless printk(), to avoid deadlocks should the printk() recurse > > + * into itself. It uses a per-CPU buffer to store the message, just like > > + * NMI. > > + */ > > +static int vprintk_safe(const char *fmt, va_list args) > > +{ > > + struct printk_safe_seq_buf *s = this_cpu_ptr(&safe_print_seq); > > + > > + return printk_safe_log_store(s, fmt, args); > > We should return zero if printk_safe_log_store() returns an error. > I know that it will get fixed in the next patch. But we should do > some minimum sanity check here because of bisection. by the way. vprintk_safe() and the entire printk_safe mechanism are not yet used in this patch. the patch that enables it comes in later. -ss