From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752679AbcHKOBw (ORCPT ); Thu, 11 Aug 2016 10:01:52 -0400 Received: from smtprelay0112.hostedemail.com ([216.40.44.112]:41076 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752463AbcHKOBv (ORCPT ); Thu, 11 Aug 2016 10:01:51 -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:2393:2553:2559:2562:2692:2895:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4559:5007:6119:6248:6261:7875:7903:8660:9040:10004:10400:10848:10967:11232:11658:11914:12517:12519:12740:13069:13148:13230:13311:13357:13439:14096:14097:14181:14659:14721:14777:21080:21433:21451:30054:30060: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:1,LUA_SUMMARY:none X-HE-Tag: waste58_fb76ea54a253 X-Filterd-Recvd-Size: 2746 Date: Thu, 11 Aug 2016 10:01:46 -0400 From: Steven Rostedt To: Miroslav Benes Cc: Linux Kernel Mailing List Subject: Re: A bug in ftrace - dynamic fops Message-ID: <20160811100146.4cb94980@gandalf.local.home> In-Reply-To: References: <20160808105303.16bf85ed@gandalf.local.home> <20160809081748.5c8e7d1b@gandalf.local.home> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; 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 Thu, 11 Aug 2016 10:46:53 +0200 (CEST) Miroslav Benes wrote: > On Tue, 9 Aug 2016, Steven Rostedt wrote: > > > On Tue, 9 Aug 2016 10:16:00 +0200 (CEST) > > Miroslav Benes wrote: > > > > > > > I agree it is kind of shooting oneself in the foot bug, because explicit > > > call to a sleeping function may not be the brightest thing to do. However > > > I see two (closely related) issues with this. > > > > > > 1. It is a change in behaviour. Ftrace silently relies on an atomicity of > > > ops->func(). I don't see it documented anywhere, but it did not matter > > > because the atomicity was always guaranteed as described above. Now there > > > is a possibility to achieve a situation which breaks the assumption. It > > > makes me worried. > > > > Why? It's something that a kernel developer should be aware of. I mean, > > that ops->func can easily be called from *any* context, like irq, > > softirq, or even an NMI. One who hooks into any function of the kernel > > should understand that it has special requirements, just like we don't > > document that you can't sleep in an NMI. > > > > And if you only hook to functions that can sleep, then great! You are > > allowed to do that too. Just like calling a module function that can > > sleep. You need to make sure nothing is calling your function when you > > unload the module. I don't see anything that is deceptive here. > > At least the comment in ftrace_shutdown() is deceptive. Which comment? It may require an update to be less "deceptive". -- Steve > > But well, I understood your opinion from the first reply. I just didn't > agree with it and that's why I expressed it. >