[lkml]   [2015]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] arm64: ftrace: stop using kstop_machine to enable/disable tracing
On Thu, 3 Dec 2015 09:38:21 +0000
Will Deacon <> wrote:

> I think you're missing the case where the instruction changes under our
> feet after we've read it but before we've replaced it (e.g. due to module
> unloading). I think that's why ftrace_modify_code has the comment about
> lack of locking thanks to stop_machine.

Note, ftrace has a module notifier that is called when a module is
being unloaded and before the text goes away. This code grabs the
ftrace_lock mutex and removes the module functions from the ftrace
list, such that it will no longer do any modifications to that module's

The update to make functions be traced is done under the ftrace_lock
mutex as well.

You do not need to worry about module text disappearing from
underneath you while you do your modifications.

Now, if there's comments that suggest otherwise, they need to be

-- Steve

 \ /
  Last update: 2015-12-03 16:21    [W:0.055 / U:4.996 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site