From: Steven Rostedt <rostedt@goodmis.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
"H. Peter Anvin" <hpa@zytor.com>, Dave Jones <davej@redhat.com>,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/5] ftrace: Synchronize variable setting with breakpoints
Date: Thu, 31 May 2012 14:50:18 -0400 [thread overview]
Message-ID: <1338490218.13348.379.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1338487413.28384.103.camel@twins>
On Thu, 2012-05-31 at 20:03 +0200, Peter Zijlstra wrote:
> On Thu, 2012-05-31 at 13:53 -0400, Steven Rostedt wrote:
> > On Thu, 2012-05-31 at 19:40 +0200, Peter Zijlstra wrote:
> > > On Thu, 2012-05-31 at 10:08 -0400, Steven Rostedt wrote:
> > > > > Also, why does this stuff live in ftrace? I always thought you were
> > > > > going to replace text_poke() so everybody that uses cross-modifying code
> > > > > could profit?
> > > >
> > > > I discussed this with Masami at Collaboration Summit. The two are
> > > > similar but also very different. But we want to start merging the two
> > > > together where it makes sense.
> > >
> > > Argh,. I so disagree. You're doing it backwards.
> > >
> > > First you merge whatever is there, regardless of who came first.
> >
> > The comment about coming first was more about 're-inventing' then about
> > merging. You can't reinvent something that didn't exist.
> >
> > That said, I didn't even think about text poke while doing this.
>
> Well, the fail is before that, how could we grow two pieces of code
> doing similar things in the first place?
Again, ftrace is slightly different as it does 30,000 changes at once,
on top of known nops. This was done through stop_machine(), thus any
slowdown was a large hit to system performance. text_poke() took the way
of mapping a page to do the change, and Mathieu didn't want to change
that (IIRC). But now we want the two to be similar.
>
> > I was
> > just simply thinking about removing stop_machine from ftrace, that
> > required this. It was only a after thought that text_poke() could do the
> > same. And this came up at Collab, where I thought, oh yeah! we can
> > incorporate this with text poke.
>
> But but but but.. the thing far back when Mathieu proposed the int3
> scheme it was text_poke().. how.. did you not think of it this time!?
Right, but we disagreed on its implementation, and yes, the idea came
from that, but I thought text_poke() was so different that it wouldn't
apply. It wasn't until Masami suggested changing text_poke() to be more
like what ftrace does, that I really took thought into it.
>
> >
> > > Then, when everybody doing text modification is using the same
> > > interface, do a second implementation using a Kconfig knob. If the scary
> > > new one breaks, no sweat, flip the config. If its proven stable, kill
> > > off the old one.
> >
> > What do you suggest then? To revert the code and rewrite it so that
> > text_poke() does a similar thing?
>
> Too late for that now I guess.. I just wonder why you all thought it was
> a good idea to have two pieces of code doing cross-modifying-code. I
> always assumed ftrace used text_poke().
Well, it was more of two different people working on two different
things. We really didn't look too closely at each others work. It was
more a social failure than a technical one.
>
> I hardly ever use dyn-ftrace but I do use some text_poke() through
> jump_labels.
You don't use function tracer? That's dyn-ftrace.
But still, we need to keep the record as small as possible because it is
persistent throughout the life of the system running. Every location
must be recorded, and maintain a state (flags).
Text_poke() mostly grew out of the jump-label work. But yes, there's
still a lot that can be shared. The actual code modification may be.
>
> I would still like to end up with one code base doing CMC with two
> implementations depending on a Kconfig knob.
You mean keep stop_machine around?
-- Steve
next prev parent reply other threads:[~2012-05-31 18:50 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-31 1:28 [PATCH 0/5] [GIT PULL] ftrace: Fix bug with function tracing and lockdep Steven Rostedt
2012-05-31 1:28 ` [PATCH 1/5] ftrace: Synchronize variable setting with breakpoints Steven Rostedt
2012-05-31 11:06 ` Peter Zijlstra
2012-05-31 14:08 ` Steven Rostedt
2012-05-31 15:16 ` Masami Hiramatsu
2012-05-31 15:29 ` Steven Rostedt
2012-05-31 17:28 ` Peter Zijlstra
2012-05-31 18:42 ` Steven Rostedt
2012-05-31 17:40 ` Peter Zijlstra
2012-05-31 17:44 ` Peter Zijlstra
2012-05-31 17:53 ` Steven Rostedt
2012-05-31 18:03 ` Peter Zijlstra
2012-05-31 18:50 ` Steven Rostedt [this message]
2012-05-31 19:06 ` Peter Zijlstra
2012-05-31 19:55 ` Mathieu Desnoyers
2012-05-31 20:10 ` Steven Rostedt
2012-05-31 20:26 ` Peter Zijlstra
2012-05-31 20:37 ` Steven Rostedt
2012-05-31 20:40 ` Steven Rostedt
2012-05-31 20:40 ` Peter Zijlstra
2012-05-31 20:49 ` Steven Rostedt
2012-06-01 4:53 ` Masami Hiramatsu
2012-06-01 11:37 ` Steven Rostedt
2012-06-01 12:52 ` Masami Hiramatsu
2012-06-01 0:45 ` Arnaldo Carvalho de Melo
2012-05-31 1:28 ` [PATCH 2/5] ftrace: Use breakpoint method to update ftrace caller Steven Rostedt
2012-05-31 11:18 ` Peter Zijlstra
2012-05-31 14:19 ` Steven Rostedt
2012-05-31 1:28 ` [PATCH 3/5] x86: Reset the debug_stack update counter Steven Rostedt
2012-05-31 19:19 ` H. Peter Anvin
2012-05-31 19:26 ` Steven Rostedt
2012-05-31 1:28 ` [PATCH 4/5] x86: Allow nesting of the debug stack IDT setting Steven Rostedt
2012-05-31 18:44 ` H. Peter Anvin
2012-05-31 18:58 ` H. Peter Anvin
2012-05-31 19:25 ` Steven Rostedt
2012-05-31 19:27 ` H. Peter Anvin
2012-05-31 20:00 ` Steven Rostedt
2012-05-31 20:17 ` H. Peter Anvin
2012-05-31 20:35 ` Steven Rostedt
2012-05-31 20:39 ` H. Peter Anvin
2012-05-31 20:56 ` Steven Rostedt
2012-05-31 21:09 ` H. Peter Anvin
2012-05-31 21:37 ` Steven Rostedt
2012-05-31 21:38 ` Steven Rostedt
2012-06-01 2:30 ` Steven Rostedt
2012-05-31 1:28 ` [PATCH 5/5] ftrace/x86: Do not change stacks in DEBUG when calling lockdep Steven Rostedt
2012-05-31 2:13 ` [PATCH 0/5] (for 3.5)[GIT PULL] ftrace: Fix bug with function tracing and lockdep 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=1338490218.13348.379.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=davej@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.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®