[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070531220742.GG904@Krystal>
Date: Thu, 31 May 2007 18:07:42 -0400
From: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To: Andi Kleen <andi@...stfloor.org>
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [patch 9/9] Scheduler profiling - Use conditional calls
* Andi Kleen (andi@...stfloor.org) wrote:
> Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca> writes:
> > }
> > - profile_hit(SCHED_PROFILING, __builtin_return_address(0));
> > + cond_call(profile_on,
> > + profile_hit(SCHED_PROFILING, __builtin_return_address(0)));
>
> Would it be possible to use a syntax like
>
> if (unlikely_cond_call(variable)) { (or better name)
> ...
> }
>
> instead? I think that would be much nicer to read than having
> code in a macro argument
>
I see your point, but there is a level of control on the branch I would
lack by doing so: the ability to put the call in either the if or else
branch. It is an optimization on i386.
I could do it by defining my home-made if() :
cond_if (cond_call_name) {
code
}
The macro cond_if could then expand (this is a simplified example) in either in
if (cond)
or
if (cond)
else
Also, I live in the expectation that, someday, the gcc guys will be nice
enough to add some kind of support for a nop-based jump that would
require code patching to put a jump instead. If it ever happens, my
macro could evolve into this for newer compiler versions, which I could
not do with the if() statement you are proposing.
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists