From: Mathieu Desnoyers <compudj@krystal.dyndns.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>, Ingo Molnar <mingo@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH ftrace.git] Immedate Values Optimized Jump Fix
Date: Fri, 18 Jul 2008 17:12:05 -0400 [thread overview]
Message-ID: <20080718211205.GA5423@Krystal> (raw)
In-Reply-To: <4880F410.3090804@zytor.com>
* H. Peter Anvin (hpa@zytor.com) wrote:
> Mathieu Desnoyers wrote:
>>>
>>> $ git-log-line linus.. arch/x86/kernel/immediate.c
>>> ee563d6: immediate values: jump liveliness
>>> e26875a: Immediate Values - Jump
>>> 3fc8d03: Immediate Values - x86 Optimization NMI and MCE support
>>>
>>> ... but the topic is stalled right now, due to hpa having had objections.
>>> Have those concerns been resolved? (Peter Cc:-ed)
>>>
>>> i'd have applied this fix, but it does not apply. The first chunk seems
>>> already be present (in a different form), the second chunk looks much
>>> different.
>> Hrm, I've edited directly the immediate values: jump liveliness patches,
>> which explains why it does not apply. I'll try to unapply/reapply/fold
>> the patches and see what it gives.
>> Plus, I've noticed that the "Text Edit Lock" patches are not in the
>> immediates branch, thus it fails to compile. Immediate values depends on
>> the Text Edit Lock patches.
>
> My previous objection was that flow of control really does need to be
> understood by the compiler, and I don't see how that could have been
> resolved without involving gcc.
>
> I'm not opposed to static jump optimization in general, far from it, but
> doing it behind the back of the compiler is fraught with peril, and even if
> it can be made correct is going to generate bad enough code that I have to
> question if it is worth the additional complexity.
>
> I definitely do not approve of the attempt to truncate liveliness by
> putting a clobber after the if branch; there is still intervening code
> generated by the C compiler which is going to cause some extremely hard to
> debug problems at some point.
>
Hrm, I thought that by following the execution flow to both branches and
by looking at the code pattern found (load immediate, test, branch) and
by placing a constraint on the eax register to detect the liveliness
region of that variable we would be guaranteed that the compiler could
not re-use this variable outside of the pattern scope.
The generated code you are talking about will generate a different code
pattern, won't it (e.g. saving the registers on the stack before the
branch) ? And in this case, we fall-back on the standard immediate
values.
However, I agree that doing this without compiler support has been a
pain. One thing we could do while we wait for gcc support is to merge
conditional-branch based immediate values only, which are less complex,
and later on add the static jump feature when supported by the compiler.
Mathieu
> -hpa
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
next prev parent reply other threads:[~2008-07-18 21:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-17 3:17 [PATCH ftrace.git] Immedate Values Optimized Jump Fix Mathieu Desnoyers
2008-07-18 16:15 ` Ingo Molnar
2008-07-18 18:31 ` Mathieu Desnoyers
2008-07-18 19:50 ` H. Peter Anvin
2008-07-18 21:12 ` Mathieu Desnoyers [this message]
2008-07-18 23:36 ` H. Peter Anvin
2008-07-18 23:38 ` H. Peter Anvin
2008-07-18 21:51 ` [git pull tip/tracing/immediates] Immediate values fixes/redux Mathieu Desnoyers
2008-07-19 5:59 ` Mathieu Desnoyers
2008-07-18 22:32 ` [PATCH ftrace.git] Immedate Values Optimized Jump Fix Ingo Molnar
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=20080718211205.GA5423@Krystal \
--to=compudj@krystal.dyndns.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.