mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.cz>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Jiri Kosina <jkosina@suse.cz>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH v2 1/8] x86: speed up int3-based patching using less paranoid write
Date: Tue, 12 Nov 2013 11:44:32 +0100	[thread overview]
Message-ID: <1384253072.1296.21.camel@pathway.suse.cz> (raw)
In-Reply-To: <20131108074336.29dfbc15@gandalf.local.home>

Steven Rostedt píše v Pá 08. 11. 2013 v 07:43 -0500:
> On Fri, 08 Nov 2013 21:04:26 +0900
> Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> wrote:
> 
> > (2013/11/08 18:12), Petr Mladek wrote:
> > > This change is inspired by the int3-based patching code used in
> > > ftrace. See the commit fd4363fff3d9 (x86: Introduce int3
> > > (breakpoint)-based instruction patching).
> > > 
> > > When trying to use text_poke_bp in ftrace, the result was slower than
> > > the original implementation.
> > > 
> > > It turned out that one difference was in text_poke vs. ftrace_write.
> > > text_poke did many extra operations to make sure that the change
> > > was atomic.
> > 
> > AFAIK, the main reason why text_poke is used is avoiding
> > RODATA protection (by alias mapping).
> 
> That is correct, and the reason ftrace didn't do that is because it
> would be quite expensive to map 22,000 addresses for each change.

I see. I am going to prepare v3 with the following changes:

	+ use text_poke in text_poke_bp back again because it is not
          effective to make the pages rw only for a single address;
          the alias mapping is faster here

	+ use the faster text_poke_part only in text_poke_bp_iter;
          the caller of this function will be responsible for
          making the code rw

	+ I will rework the error handling as suggested in the other
          mails; I will try to add some also for text_poke.

Thanks a lot for hints.

Best Regards,
Petr


  reply	other threads:[~2013-11-12 10:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08  9:12 [PATCH v2 0/8] x86: use new text_poke_bp in ftrace Petr Mladek
2013-11-08  9:12 ` Petr Mladek
2013-11-08  9:12 ` [PATCH v2 1/8] x86: speed up int3-based patching using less paranoid write Petr Mladek
2013-11-08 12:04   ` Masami Hiramatsu
2013-11-08 12:43     ` Steven Rostedt
2013-11-12 10:44       ` Petr Mladek [this message]
2013-11-08 14:49     ` Steven Rostedt
2013-11-08  9:12 ` [PATCH v2 2/8] x86: return error code in text_poke_bp Petr Mladek
2013-11-08 12:36   ` Masami Hiramatsu
2013-11-08 14:53   ` Steven Rostedt
2013-11-08  9:12 ` [PATCH v2 3/8] x86: allow to call text_poke_bp during boot Petr Mladek
2013-11-08  9:12 ` [PATCH v2 4/8] x86: add generic function to modify more calls using int3 framework Petr Mladek
2013-11-08  9:12 ` [PATCH v2 5/8] x86: do not trace __probe_kernel_read Petr Mladek
2013-11-08  9:12 ` [PATCH v2 6/8] x86: modify ftrace function using the new int3-based framework Petr Mladek
2013-11-08  9:12 ` [PATCH v2 7/8] x86: patch all traced function calls using the " Petr Mladek
2013-11-08  9:12 ` [PATCH v2 8/8] x86: enable/disable ftrace graph call using new " Petr Mladek

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=1384253072.1296.21.camel@pathway.suse.cz \
    --to=pmladek@suse.cz \
    --cc=fweisbec@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=x86@kernel.org \
    /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®