From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751749AbcJJB40 (ORCPT ); Sun, 9 Oct 2016 21:56:26 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34720 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbcJJB4Z (ORCPT ); Sun, 9 Oct 2016 21:56:25 -0400 Date: Sat, 8 Oct 2016 04:33:03 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Jan Kara , Andrew Morton , Tejun Heo , Calvin Owens , Thomas Gleixner , Mel Gorman , Steven Rostedt , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC][PATCHv2 3/7] printk: introduce per-cpu alt_print seq buffer Message-ID: <20161007193303.GA3496@swordfish> References: <20160930151758.8965-1-sergey.senozhatsky@gmail.com> <20160930151758.8965-4-sergey.senozhatsky@gmail.com> <20161006130849.GG13369@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161006130849.GG13369@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 (10/06/16 15:08), Petr Mladek wrote: [..] > > +static int vprintk_nmi(const char *fmt, va_list args) > > +{ > > + struct alt_printk_seq_buf *s = this_cpu_ptr(&nmi_print_seq); > > + int add; > > + > > + add = alt_printk_log_store(s, fmt, args); > > + if (!add) > > + atomic_inc(&nmi_message_lost); > > This would could also empty string as an error. A solution might be > update alt_printk_log_store() to return -1 in case of lost log. > Note that vprintk_nmi() still needs to return 0 in this case to > stay compatible with printk(). will do. > > +static int vprintk_alt(const char *fmt, va_list args) > > +{ > > + struct alt_printk_seq_buf *s = this_cpu_ptr(&alt_print_seq); > > + > > + return alt_printk_log_store(s, fmt, args); > > We should handle lost strings here as well. But it can be > done in a followup patch. ok, will do. -ss