mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Miroslav Benes <mbenes@suse.cz>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: A bug in ftrace - dynamic fops
Date: Thu, 11 Aug 2016 10:01:46 -0400	[thread overview]
Message-ID: <20160811100146.4cb94980@gandalf.local.home> (raw)
In-Reply-To: <alpine.LNX.2.00.1608111042220.26452@pobox.suse.cz>

On Thu, 11 Aug 2016 10:46:53 +0200 (CEST)
Miroslav Benes <mbenes@suse.cz> wrote:

> On Tue, 9 Aug 2016, Steven Rostedt wrote:
> 
> > On Tue, 9 Aug 2016 10:16:00 +0200 (CEST)
> > Miroslav Benes <mbenes@suse.cz> 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. 
> 

  reply	other threads:[~2016-08-11 14:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08  8:57 Miroslav Benes
2016-08-08 14:53 ` Steven Rostedt
2016-08-09  8:16   ` Miroslav Benes
2016-08-09 12:17     ` Steven Rostedt
2016-08-11  8:46       ` Miroslav Benes
2016-08-11 14:01         ` Steven Rostedt [this message]
2016-08-11 14:08           ` Miroslav Benes
2016-08-11 14:33             ` Steven Rostedt
2016-08-11 14:54               ` Miroslav Benes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160811100146.4cb94980@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®