Re: [PATCH] Scheduler Profiling - Use Immediate Values

Mathieu Desnoyers
2007-09-12T14:20:05Z

* Andi Kleen (andi@firstfloor.org) wrote:
> Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> writes:
> >
> > - profile_hit(SCHED_PROFILING, __builtin_return_address(0));
> > + immediate_if (&sched_profiling)
>
> I must say I really dislike immediate_if(). You complained earlier
> that something breaks coloring, but adding such macros will definitely
> break a lot of editors (especially if you use it without {} like here)
>
> It would be much nicer and readable to just use if
> (unlikely(immediate_read(&x)) or if you prefer to hide the unlikely
> if (immediate_bool_test(&x)) with an implicit unlikely().
>
> -Andi

Please refer to :

http://lkml.org/lkml/2007/7/3/301

The idea is not to hide the unlikely, but to leave the opportunity to
make this primitive evolve in something that won't depend on a load
immediate and only require patching of a jump, given the appropriate gcc
support (yet to come).

Mathieu