From: Ingo Molnar <mingo@elte.hu>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [patch 0/2] Immediate Values - jump patching update
Date: Mon, 28 Apr 2008 14:48:33 +0200 [thread overview]
Message-ID: <20080428124833.GE27997@elte.hu> (raw)
In-Reply-To: <20080428033415.303000651@polymtl.ca>
* Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
> Hi Ingo,
>
> Here is the update to the jump patching optimization taking care of
> Peter's comments about register liveliness and instruction re-use by
> gcc optimizations. A good thing : it actually simplifies the code.
> Unfortunately, it adds 3 bytes to the instructions in i-cache because
> I now have to use a 5-bytes mov instruction so I can replace it with a
> 5-bytes jump. Therefore, 9 bytes are added to rather small functions
> (5-bytes mov + 2-bytes test + 2 bytes conditional branch) and 13 bytes
> are added to larger functions which needs a 6 bytes conditional branch
> at the branch site.
>
> Instead of having to execute a sequence of nop, nop and jump, we now
> only have to execute the near jump, which jumps either at the address
> following the conditional branch or at the target address of the
> conditional branch, depending on the immediate value variable state.
>
> Thanks to Peter for the review.
thanks Mathieu, i've queued them up for more testing. Your previous
queue already looked good here so i pushed it out into sched-devel.git
as you probably noticed.
Sidenote, without trying to bikeshed paint this issue too much: are we
absolutely sure that (on modern CPU architectures) such a short jump is
better than just 2-3 NOPs in a sequence? It's a minor (sub-cycle) detail
in any case.
Ingo
next prev parent reply other threads:[~2008-04-28 12:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-28 3:34 Mathieu Desnoyers
2008-04-28 3:34 ` [patch 1/2] Immediate Values - jump liveliness Mathieu Desnoyers
2008-04-28 3:34 ` [patch 2/2] Markers - use imv_cond " Mathieu Desnoyers
2008-04-28 12:48 ` Ingo Molnar [this message]
2008-04-28 14:35 ` [patch 0/2] Immediate Values - jump patching update Mathieu Desnoyers
2008-04-28 17:21 ` H. Peter Anvin
2008-04-28 20:25 ` Ingo Molnar
2008-04-28 21:03 ` H. Peter Anvin
2008-04-28 22:11 ` Ingo Molnar
2008-04-28 22:25 ` H. Peter Anvin
2008-04-28 22:44 ` Ingo Molnar
2008-04-28 23:06 ` H. Peter Anvin
2008-04-29 0:47 ` Frank Ch. Eigler
2008-04-29 1:08 ` H. Peter Anvin
2008-04-29 12:08 ` Ingo Molnar
2008-05-14 14:53 ` Pavel Machek
2008-04-29 1:46 ` Mathieu Desnoyers
2008-04-29 2:07 ` H. Peter Anvin
2008-04-29 12:18 ` Mathieu Desnoyers
2008-04-29 15:35 ` H. Peter Anvin
2008-05-04 14:54 ` Mathieu Desnoyers
2008-05-04 21:05 ` H. Peter Anvin
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=20080428124833.GE27997@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
/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
Powered by JetHome