Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758521AbcLARAz (ORCPT ); Thu, 1 Dec 2016 12:00:55 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36610 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933208AbcLARAx (ORCPT ); Thu, 1 Dec 2016 12:00:53 -0500 Date: Thu, 1 Dec 2016 09:00:48 -0800 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Josh Poimboeuf , Petr Mladek , 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: <20161129162920.GF21230@pathway.suse.cz> <20161129171038.GN3092@twins.programming.kicks-ass.net> <20161129193935.GE3924@linux.vnet.ibm.com> <20161129195204.GG3045@worktop.programming.kicks-ass.net> <20161129200711.GF3924@linux.vnet.ibm.com> <20161129203259.GA28037@linux.vnet.ibm.com> <20161130191303.prvrgkvijqzydexg@treble> <20161201055235.GG3092@twins.programming.kicks-ass.net> <20161201123316.GZ3924@linux.vnet.ibm.com> <20161201164107.GN3092@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161201164107.GN3092@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16120117-0016-0000-0000-0000055068A8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006174; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000193; SDB=6.00787913; UDB=6.00381187; IPR=6.00565590; BA=6.00004935; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013503; XFM=3.00000011; UTC=2016-12-01 17:00:49 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16120117-0017-0000-0000-0000351F5256 Message-Id: <20161201170048.GH3924@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-01_13:,, 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-1612010291 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1452 Lines: 35 On Thu, Dec 01, 2016 at 05:41:07PM +0100, Peter Zijlstra wrote: > On Thu, Dec 01, 2016 at 04:33:16AM -0800, Paul E. McKenney wrote: > > On Thu, Dec 01, 2016 at 06:52:35AM +0100, Peter Zijlstra wrote: > > > On Wed, Nov 30, 2016 at 01:13:03PM -0600, Josh Poimboeuf wrote: > > > > This question was probably intended for other folks, but I should point > > > > out that idle tasks *do* invoke the scheduler. cpu_idle_loop() calls > > > > schedule_preempt_disabled(). > > > > > > Right, but that doesn't matter I think. The below will simply not call > > > rcu_note_voluntary_context_switch() from the idle task, which would be > > > fine I think. > > > > > > > > So is the following a sensible approach, or should I look elsewhere? > > > > > > > > > > #define cond_resched_rcu_qs() \ > > > > > do { \ > > > > > if (!is_idle_task(current) && !cond_resched()) \ > > > > > rcu_note_voluntary_context_switch(current); \ > > > > > > You should reverse your conditions though: > > > > > > if (!cond_resched() && !is_idle_task(current)) > > > rcu_note_voluntary_context_switch(current); > > > > > > That way we'll still do cond_resched() and you only gate the RCU call. > > > > This makes it illegal at early boot. > > Humm, how early are we talking? The case I saw was during start_kernel(), IIRC. But again, it turned out that the patch putting cond_resched_rcu_qs() in that early was (1) broken and (2) unnecessary. Thanx, Paul