From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752279AbbJTSUd (ORCPT ); Tue, 20 Oct 2015 14:20:33 -0400 Received: from smtprelay0214.hostedemail.com ([216.40.44.214]:42116 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751719AbbJTSU3 (ORCPT ); Tue, 20 Oct 2015 14:20:29 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3872:3873:4321:5007:6261:7875:7901:10004:10400:10848:10967:11026:11232:11473:11658:11914:12517:12519:12555:12663:12740:13069:13311:13357:21080:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: crib98_211545e33a418 X-Filterd-Recvd-Size: 2789 Date: Tue, 20 Oct 2015 14:20:26 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: "Paul E. McKenney" , LKML , Rusty Russell Subject: Re: [PATCH] module: Prevent recursion bug caused by module RCU check Message-ID: <20151020142026.60e64a9e@gandalf.local.home> In-Reply-To: <20151020170905.GV11639@twins.programming.kicks-ass.net> References: <20151020122103.66ab250a@gandalf.local.home> <20151020163952.GI17308@twins.programming.kicks-ass.net> <20151020165331.GU11639@twins.programming.kicks-ass.net> <20151020170905.GV11639@twins.programming.kicks-ass.net> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; 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 Tue, 20 Oct 2015 19:09:05 +0200 Peter Zijlstra wrote: > On Tue, Oct 20, 2015 at 06:53:31PM +0200, Peter Zijlstra wrote: > > Also, would it not be better to fix WARN_ON_ONCE() instead? > > > > Clearly I'm an idiot and should stay away from the computer... Hehe, > > --- > include/asm-generic/bug.h | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h > index 630dd2372238..d0972fc8433f 100644 > --- a/include/asm-generic/bug.h > +++ b/include/asm-generic/bug.h > @@ -110,9 +110,10 @@ extern void warn_slowpath_null(const char *file, const int line); > static bool __section(.data.unlikely) __warned; \ > int __ret_warn_once = !!(condition); \ > \ > - if (unlikely(__ret_warn_once)) \ > - if (WARN_ON(!__warned)) \ > - __warned = true; \ > + if (unlikely(__ret_warn_once && !__warned)) { \ > + __warned = true; \ > + WARN_ON(1); \ > + } \ > unlikely(__ret_warn_once); \ > }) I thought about it too, but was too busy to think harder about it. I may have made the same mistakes as you. -- Steve > > @@ -120,9 +121,10 @@ extern void warn_slowpath_null(const char *file, const int line); > static bool __section(.data.unlikely) __warned; \ > int __ret_warn_once = !!(condition); \ > \ > - if (unlikely(__ret_warn_once)) \ > - if (WARN(!__warned, format)) \ > - __warned = true; \ > + if (unlikely(__ret_warn_once && !__warned)) { \ > + __warned = true; \ > + WARN(1, format); \ > + } \ > unlikely(__ret_warn_once); \ > }) >