Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754217AbbFKJ5M (ORCPT ); Thu, 11 Jun 2015 05:57:12 -0400 Received: from cantor2.suse.de ([195.135.220.15]:32992 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751162AbbFKJ5I (ORCPT ); Thu, 11 Jun 2015 05:57:08 -0400 Date: Thu, 11 Jun 2015 11:57:05 +0200 From: Petr Mladek To: Peter Zijlstra Cc: Steven Rostedt , linux-kernel@vger.kernel.org, jkosina@suse.cz, paulmck@linux.vnet.ibm.com, Ingo Molnar , Thomas Gleixner Subject: Re: [RFC][PATCH] printk: Fixup the nmi printk mess Message-ID: <20150611095705.GF9409@pathway.suse.cz> References: <20150610125509.GO19282@twins.programming.kicks-ass.net> <20150610143155.GD9409@pathway.suse.cz> <20150610152917.GI3644@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150610152917.GI3644@twins.programming.kicks-ass.net> 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 Content-Length: 1313 Lines: 36 On Wed 2015-06-10 17:29:17, Peter Zijlstra wrote: > On Wed, Jun 10, 2015 at 04:31:55PM +0200, Petr Mladek wrote: > > If another NMI comes at this point, it will start filling the buffer > > from the beginning. If it is fast enough, it might override the text > > that we print above. > > How so? If the cmpxchg succeeded and len == 0, we flushed everything and > are done with it, if another NMI comes in and 'overwrites' it, that's > fine, right? Shame on me. Somehow I thought that there was xchg() and not cmpxchg(). > > > +static int vprintk_nmi(const char *fmt, va_list args) > > > +{ > > > + struct nmi_seq_buf *s = this_cpu_ptr(&nmi_print_seq); > > > + unsigned int len = seq_buf_used(&s->seq); > > > + > > > + irq_work_queue(&s->work); > > > + seq_buf_vprintf(&s->seq, fmt, args); > > No, everything is strictly per cpu. I do not know why but I expected that irq_work could get proceed on any CPU. You are right. They are proceed on the same one. Similar with the other mail. Sigh, I was too fast yesterday. I am sorry for the noise. Best Regards, Petr -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/