Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933447AbcK2SCA (ORCPT ); Tue, 29 Nov 2016 13:02:00 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51610 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933351AbcK2SBp (ORCPT ); Tue, 29 Nov 2016 13:01:45 -0500 Date: Tue, 29 Nov 2016 10:01:41 -0800 From: "Paul E. McKenney" To: Petr Mladek 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 Reply-To: paulmck@linux.vnet.ibm.com 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> <20161129161246.GB24060@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161129161246.GB24060@pathway.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112918-0012-0000-0000-0000114375FE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006164; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000193; SDB=6.00786974; UDB=6.00380623; IPR=6.00564662; BA=6.00004928; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013481; XFM=3.00000011; UTC=2016-11-29 18:01:43 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112918-0013-0000-0000-0000479567F1 Message-Id: <20161129180141.GY3924@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-29_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611290300 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2699 Lines: 57 On Tue, Nov 29, 2016 at 05:12:46PM +0100, Petr Mladek wrote: > On Tue 2016-11-29 09:09:17, Josh Poimboeuf wrote: > > On Tue, Nov 29, 2016 at 06:07:34AM -0800, Paul E. McKenney wrote: > > > On Tue, Nov 29, 2016 at 10:16:50AM +0100, Peter Zijlstra wrote: > > > > On Mon, Nov 28, 2016 at 11:52:41PM -0600, Josh Poimboeuf wrote: > > > > > > We used to do that, but the resulting NMIs were problematic on some > > > > > > platforms. Perhaps things have gotten better? > > > > > > > > > > Did a little digging on git blame and found the following commit (which > > > > > seems to be the cause of the KASAN warning and missing stack dump): > > > > > > > > > > bc1dce514e9b ("rcu: Don't use NMIs to dump other CPUs' stacks") > > > > > > > > > > I presume this commit is still needed because of the NMI printk deadlock > > > > > issues which were discussed at Kernel Summit. I guess those issues need > > > > > to be sorted out before the above commit can be reverted. > > > > > > > > so printk should more or less work from NMI, esp. after: > > > > > > > > 42a0bb3f7138 ("printk/nmi: generic solution for safe printk in NMI") > > > > > > And of course bc1dce514e9b doesn't revert cleanly, but see hand reversion > > > below. Also, 42a0bb3f7138's commit log calls out MN10300 and Xtensa as > > > needing more work. Has that happened? > > > > Petr M, any idea? > > These two architectures do not support the safe printk in NMI. But > these architectures also do not implement trigger_all_cpu_backtrace() > and other trigger_*_backtrace() functions. Therefore these functions > return false there. > > In fact, only very few architectures implement trigger_*_backtrace(). > And only few of them use NMI (x86, arm, tile). I have just double > checked that these all use the safe printk in NMI. > > By other words, if trigger_all_cpu_backtrace() or > trigger_single_cpu_backtrace() returns true, it should be NMI safe > and you could use it here. Good, I will upgrade my commit to Signed-off-by, then. > > > But I really like the fact that RCU CPU stall warnings dump only those > > > stacks that are likely to be involved, and the patch below goes back > > > to dumping everyone. Shouldn't be that hard to fix, though... > > > > There's a new trigger_single_cpu_backtrace() function which can be used > > for that. > > There is newly also trigger_cpumask_backtrace(struct cpumask *mask) > where you could select more CPUs using the mask. If this is of any help. In my experience, there is almost never a large number of CPUs stalling a given RCU grace period. But thank you for letting me know about trigger_cpumask_backtrace(), as it might be useful in the future. Thanx, Paul