Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933789AbcK3J7f (ORCPT ); Wed, 30 Nov 2016 04:59:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:60552 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932982AbcK3JaD (ORCPT ); Wed, 30 Nov 2016 04:30:03 -0500 Date: Wed, 30 Nov 2016 10:29:59 +0100 From: Petr Mladek To: "Paul E. McKenney" Cc: Josh Poimboeuf , Peter Zijlstra , Vince Weaver , "linux-kernel@vger.kernel.org" , Ingo Molnar , Arnaldo Carvalho de Melo , "dvyukov@google.com" Subject: Re: perf: fuzzer BUG: KASAN: stack-out-of-bounds in __unwind_start Message-ID: <20161130092959.GC24060@pathway.suse.cz> References: <20161128215411.fkis7bbimjy4v4j7@treble> <20161129004021.GL3924@linux.vnet.ibm.com> <20161129055241.6dy2dt4q4ptazk2s@treble> <20161129091650.GA3092@twins.programming.kicks-ass.net> <20161129140734.GQ3924@linux.vnet.ibm.com> <20161129150917.tk5xkl7teveybaxa@treble> <20161129165152.GV3924@linux.vnet.ibm.com> <20161129171725.dql7evlzqiit63a3@treble> <20161129173600.GW3924@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161129173600.GW3924@linux.vnet.ibm.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 Content-Length: 2704 Lines: 71 On Tue 2016-11-29 09:36:00, Paul E. McKenney wrote: > Updated (but still untested) commit below. > > > Thanx, Paul > > ------------------------------------------------------------------------ > > commit d3df9bc5fb5d838b049f32a476721eadbc349553 > Author: Paul E. McKenney > Date: Tue Nov 29 05:49:06 2016 -0800 > > rcu: Once again use NMI-based stack traces in stall warnings > > This commit is for all intents and purposes a revert of bc1dce514e9b > ("rcu: Don't use NMIs to dump other CPUs' stacks"). The reason to suppose > that this can now safely be reverted is the presence of 42a0bb3f7138 > ("printk/nmi: generic solution for safe printk in NMI"), which is said > to have made NMI-based stack dumps safe. > > However, this reversion keeps one nice property of bc1dce514e9b > ("rcu: Don't use NMIs to dump other CPUs' stacks"), namely that > only those CPUs blocking the grace period are dumped. The new > trigger_single_cpu_backtrace() is used to make this happen, as > suggested by Josh Poimboeuf. > > Reported-by: Vince Weaver > Not-yet-signed-off-by: Paul E. McKenney > Cc: Petr Mladek > Cc: Peter Zijlstra > Reviewed-by: Josh Poimboeuf Looks fine to me. Reviewed-by: Petr Mladek Best Regards, Petr > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 91a68e4e6671..ba0e4825be9d 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -1396,7 +1396,10 @@ static void rcu_check_gp_kthread_starvation(struct rcu_state *rsp) > } > > /* > - * Dump stacks of all tasks running on stalled CPUs. > + * Dump stacks of all tasks running on stalled CPUs. First try using > + * NMIs, but fall back to manual remote stack tracing on architectures > + * that don't support NMI-based stack dumps. The NMI-triggered stack > + * traces are more accurate because they are printed by the target CPU. > */ > static void rcu_dump_cpu_stacks(struct rcu_state *rsp) > { > @@ -1406,11 +1409,10 @@ static void rcu_dump_cpu_stacks(struct rcu_state *rsp) > > rcu_for_each_leaf_node(rsp, rnp) { > raw_spin_lock_irqsave_rcu_node(rnp, flags); > - if (rnp->qsmask != 0) { > - for_each_leaf_node_possible_cpu(rnp, cpu) > - if (rnp->qsmask & leaf_node_cpu_bit(rnp, cpu)) > + for_each_leaf_node_possible_cpu(rnp, cpu) > + if (rnp->qsmask & leaf_node_cpu_bit(rnp, cpu)) > + if (!trigger_single_cpu_backtrace(cpu)) > dump_cpu_task(cpu); > - } > raw_spin_unlock_irqrestore_rcu_node(rnp, flags); > } > } >