linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Jiri Kosina <jkosina@suse.cz>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Vojtech Pavlik <vojtech@suse.cz>,
	Seth Jennings <sjenning@redhat.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	"H. Peter Anvin" <hpa@linux.intel.com>
Subject: Re: [for-next][PATCH 3/4] ftrace/x86: Allow !CONFIG_PREEMPT dynamic ops to use allocated trampolines
Date: Wed, 5 Nov 2014 11:46:43 +0100	[thread overview]
Message-ID: <20141105104643.GC5245@pd.tnic> (raw)
In-Reply-To: <20141027182948.581142569@goodmis.org>

On Mon, Oct 27, 2014 at 02:27:05PM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
> 
> When the static ftrace_ops (like function tracer) enables tracing, and it
> is the only callback that is referencing a function, a trampoline is
> dynamically allocated to the function that calls the callback directly
> instead of calling a loop function that iterates over all the registered
> ftrace ops (if more than one ops is registered).
> 
> But when it comes to dynamically allocated ftrace_ops, where they may be
> freed, on a CONFIG_PREEMPT kernel there's no way to know when it is safe
> to free the trampoline. If a task was preempted while executing on the
> trampoline, there's currently no way to know when it will be off that
> trampoline.
> 
> But this is not true when it comes to !CONFIG_PREEMPT. The current method
> of calling schedule_on_each_cpu() will force tasks off the trampoline,
> becaues they can not schedule while on it (kernel preemption is not
> configured). That means it is safe to free a dynamically allocated
> ftrace ops trampoline when CONFIG_PREEMPT is not configured.
> 
> Cc: H. Peter Anvin <hpa@linux.intel.com>
> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Acked-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

  parent reply	other threads:[~2014-11-05 10:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 18:27 [for-next][PATCH 0/4] ftrace: Add dynamic trampoline support Steven Rostedt
2014-10-27 18:27 ` [for-next][PATCH 1/4] ftrace/x86: Add dynamic allocated trampoline for ftrace_ops Steven Rostedt
2014-10-30 17:00   ` Steven Rostedt
2014-10-31  5:19   ` Masami Hiramatsu
2014-10-31 16:01     ` Steven Rostedt
2014-11-03  7:50       ` Masami Hiramatsu
2014-11-05 10:28   ` Borislav Petkov
2014-11-06 13:57     ` Steven Rostedt
2014-11-06 15:01       ` Borislav Petkov
2014-10-27 18:27 ` [for-next][PATCH 2/4] ftrace/x86: Show trampoline call function in enabled_functions Steven Rostedt
2014-10-30 17:00   ` Steven Rostedt
2014-11-05 10:42   ` Borislav Petkov
2014-11-06 14:01     ` Steven Rostedt
2014-10-27 18:27 ` [for-next][PATCH 3/4] ftrace/x86: Allow !CONFIG_PREEMPT dynamic ops to use allocated trampolines Steven Rostedt
2014-10-30 17:01   ` Steven Rostedt
2014-11-05 10:46   ` Borislav Petkov [this message]
2014-10-27 18:27 ` [for-next][PATCH 4/4] ftrace: Add more information to ftrace_bug() output Steven Rostedt
2014-10-30 17:02   ` Steven Rostedt
2014-11-05 10:49   ` Borislav Petkov
2014-10-29 16:27 ` [for-next][PATCH 0/4] ftrace: Add dynamic trampoline support Jiri Kosina
2014-10-30 16:56   ` Steven Rostedt
2014-10-30 17:08     ` Jiri Kosina
2014-10-31 10:04 ` Masami Hiramatsu

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=20141105104643.GC5245@pd.tnic \
    --to=bp@alien8.de \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@linux.intel.com \
    --cc=jkosina@suse.cz \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=sjenning@redhat.com \
    --cc=vojtech@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;
as well as URLs for NNTP newsgroup(s).