From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933920AbdDESyi (ORCPT ); Wed, 5 Apr 2017 14:54:38 -0400 Received: from mail.kernel.org ([198.145.29.136]:44118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754967AbdDESy3 (ORCPT ); Wed, 5 Apr 2017 14:54:29 -0400 Date: Wed, 5 Apr 2017 14:54:25 -0400 From: Steven Rostedt To: "Paul E. McKenney" Cc: LKML Subject: Re: [BUG] stack tracing causes: kernel/module.c:271 module_assert_mutex_or_preempt Message-ID: <20170405145425.357937b8@gandalf.local.home> In-Reply-To: <20170405175925.GG1600@linux.vnet.ibm.com> References: <20170405093207.404f8deb@gandalf.local.home> <20170405162515.GF1600@linux.vnet.ibm.com> <20170405124539.730a2365@gandalf.local.home> <20170405175925.GG1600@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 Apr 2017 10:59:25 -0700 "Paul E. McKenney" wrote: > > Note, this has nothing to do with trace_rcu_dyntick(). It's the > > function tracer tracing inside RCU, calling the stack tracer to record > > a new stack if it sees its larger than any stack before. All I need is > > a way to tell the stack tracer to not record a stack if it is in this > > RCU critical section. > > > > If you can add a "in_rcu_critical_section()" function, that the stack > > tracer can test, and simply exit out like it does if in_nmi() is set, > > that would work too. Below is my current work around. > > Except that the rcu_irq_enter() would already have triggered the bug > that was (allegedly) fixed by my earlier patch. So, yes, the check for > rcu_is_watching() would work around this bug, but the hope is that > with my earlier fix, this workaround would not be needed. Note, if I had a "in_rcu_critical_section()" I wouldn't need to call rcu_irq_enter(). I could fall out before that. My current workaround does the check, even though it breaks things, it would hopefully fix things as it calls rcu_irq_exit() immediately. Would I would have is: if (in_rcu_critical_section()) goto out; rcu_irq_enter(); which would probably be the easiest fix. > > So could you please test my earlier patch? I could, but it wouldn't tell me anything immediately. It's a hard race to hit. Which I never could hit it when I tried, but it would appear to hit immediately when testing other things :-p Remember, it only triggers when a new max stack size is hit. The bug happens when that new max stack size is in the rcu critical section. I guess I could force it to trigger by inserting a call in your code that clears the max stack size. -- Steve > > This patch does not conflict with anything on -rcu, so you could > carry it if that helps. >