linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <srostedt@redhat.com>
Subject: Re: [PATCH 2/5] ftrace, x86: make kernel text writable only for conversions
Date: Fri, 20 Feb 2009 13:00:31 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.00.0902201259020.13747@gandalf.stny.rr.com> (raw)
In-Reply-To: <20090220175535.GN24538@elte.hu>


On Fri, 20 Feb 2009, Ingo Molnar wrote:

> 
> * Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > > > +/* used by ftrace */
> > > > +void set_kernel_text_rw(void)
> > > 
> > > i'd leave out the 'used by ftrace' bit - more uses might 
> > > arise. How does kprobes get around readonly pages, it uses 
> > > these APIs too, right?
> > 
> > kprobes uses text_poke. text_poke uses vmap to create its own 
> > page table pointers to the text memory, does the modification 
> > and then removes the pointers. This is quite heavy weight and 
> > since ftrace needs to modify 10s of thousands of areas, 
> > converting all of kernel text page tables is much more 
> > efficient.
> > 
> > Note, if kprobes did change the original page tables, then it 
> > too would have hit the split_large_page bug too.
> 
> i think the real reason is that kprobes was written before we 
> had this more flexible and more usable CPA code.

I'm not saying that was the reason kprobes did it that way. I was just 
answering your question about how kprobes does it today ;-)

Perhaps it may be more efficient to convert kprobes to use the 
set_memory_rw/ro API now.

-- Steve


  reply	other threads:[~2009-02-20 18:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20 16:38 [git pull] updates for tip Steven Rostedt
2009-02-20 16:38 ` [PATCH 1/5] ftrace: allow archs to preform pre and post process for code modification Steven Rostedt
2009-02-20 17:25   ` Ingo Molnar
2009-02-20 17:32     ` Steven Rostedt
2009-02-20 16:38 ` [PATCH 2/5] ftrace, x86: make kernel text writable only for conversions Steven Rostedt
2009-02-20 17:30   ` Ingo Molnar
2009-02-20 17:52     ` Steven Rostedt
2009-02-20 17:55       ` Ingo Molnar
2009-02-20 18:00         ` Steven Rostedt [this message]
2009-02-20 16:38 ` [PATCH 3/5] ftrace: immediately stop code modification if failure is detected Steven Rostedt
2009-02-20 16:38 ` [PATCH 4/5] ftrace: break out modify loop immediately on detection of error Steven Rostedt
2009-02-20 17:33   ` Ingo Molnar
2009-02-20 17:54     ` Steven Rostedt
2009-02-20 16:38 ` [PATCH 5/5] ftrace, x86: do not depend on system state for kernel text info Steven Rostedt
2009-02-20 17:34   ` Ingo Molnar
2009-02-20 17:54     ` Steven Rostedt

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=alpine.DEB.2.00.0902201259020.13747@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=srostedt@redhat.com \
    --cc=tglx@linutronix.de \
    /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).