From: Shaohua Li <shaohua.li@intel.com>
To: linux-ia64@vger.kernel.org
Subject: RE: [PATCH 5/5] IA64 dynamic ftrace support
Date: Fri, 09 Jan 2009 02:42:03 +0000 [thread overview]
Message-ID: <1231468923.10683.112.camel@sli10-desk.sh.intel.com> (raw)
In-Reply-To: <1230012500.10933.102.camel@sli10-desk.sh.intel.com>
On Thu, 2009-01-08 at 13:25 -0700, Luck, Tony wrote:
> > The patch convert it to below for nop:
> > [MII] nop.m 0x0
> > mov r3=ip
> > nop.i 0x0
> > [MLX] nop.m 0x0
> > nop.x 0x0;;
> > This isn't completely nop, as there is one instuction 'mov r3=ip', but
> > it should be light and harmless for code follow it.
>
> Did you consider using predicate registers to enable/disable. E.g.
> using something like this (using your currrent calling convention):
>
> MMI cmp.ne p6,p0=r0,r0;;
> nop.m 0
> (p06) mov r3=ip
> MLX nop.m 0
> (p06) brl.many <target_address>
>
> Then just patch the "cmp" instruction to something that makes p6 true to enable.
>
> Like this it may not be any better though ... although it avoids
> doing the "mov r3=ip" when the tracepoint is disabled ... it may still
> mess with the branch prediction logic and update entries in the branch
> target cache before the processor realizes that p6 is false and so the
> branch should be squashed.
>
> But it does give you the flexibility to pick almost any 5 instructions
> for your stub (so long as they can fit within the available templates)
> while still allowing ftrace to enable/disable them by patching just one
> instruction. So you might think of some smarter way to do this.
Ya, this should work too. Is it a nop (or as light as a nop) if an
instruction has false prediction? the 'mov r3=ip' takes overhead, but we
need it in current implementation. Better we can remove the overhead.
Instruction room doesn't matter now. instruction overhead is concerned.
Thanks,
Shaohua
prev parent reply other threads:[~2009-01-09 2:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-23 6:08 [PATCH 5/5] IA64 dynamic ftrace support Shaohua Li
2008-12-23 14:35 ` Steven Rostedt
2008-12-24 0:54 ` Shaohua Li
2008-12-24 1:00 ` Steven Rostedt
2008-12-24 8:08 ` Shaohua Li
2008-12-24 13:29 ` Steven Rostedt
2008-12-24 21:50 ` Keith Owens
2008-12-25 1:08 ` Shaohua Li
2008-12-25 3:54 ` Steven Rostedt
2008-12-25 4:01 ` Shaohua Li
2008-12-26 2:42 ` Shaohua Li
2008-12-31 9:11 ` Shaohua Li
2009-01-06 0:42 ` Luck, Tony
2009-01-08 8:05 ` Shaohua Li
2009-01-08 17:08 ` Steven Rostedt
2009-01-08 20:25 ` Luck, Tony
2009-01-08 22:24 ` Luck, Tony
2009-01-09 2:42 ` Shaohua Li [this message]
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=1231468923.10683.112.camel@sli10-desk.sh.intel.com \
--to=shaohua.li@intel.com \
--cc=linux-ia64@vger.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