Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757286AbcLAFwo (ORCPT ); Thu, 1 Dec 2016 00:52:44 -0500 Received: from merlin.infradead.org ([205.233.59.134]:47062 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750848AbcLAFwn (ORCPT ); Thu, 1 Dec 2016 00:52:43 -0500 Date: Thu, 1 Dec 2016 06:52:35 +0100 From: Peter Zijlstra To: Josh Poimboeuf Cc: "Paul E. McKenney" , 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 Message-ID: <20161201055235.GG3092@twins.programming.kicks-ass.net> References: <20161129055241.6dy2dt4q4ptazk2s@treble> <20161129124323.GJ3092@twins.programming.kicks-ass.net> <20161129151004.GU3924@linux.vnet.ibm.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161130191303.prvrgkvijqzydexg@treble> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 847 Lines: 22 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.