Re: [PATCH] [2.6] [1/2] hlist: replace explicit checks of hlist fields w/ func calls

Alex Pankratov
2004-02-12T04:53:04Z

Andi Kleen wrote:

> On Tue, 10 Feb 2004 22:57:43 -0800
> Alex Pankratov <ap@swapped.cc> wrote:
>
>
>>Ugh, yeah, I thought about this. However my understand was that
>>since hlist_null is statically allocated variable, its address
>>will be a known constant at a link time (whether it's a static
>>link or dynamic/run-time link - btw, excuse my lack of proper
>>terminology here). So comparing something to &null would be
>>equivalent to comparing to the constant and not require an
>>extra register.
>
>
> Hmm, you're right. Apparently I was still thinking about the bad
> code generated by the standard list_heads.
>

A quick note about standard lists then - circular double-linked
lists are normally described in textbooks as a clever trick
allowing to avoid if's in insert() and delete(). Given what you
have noted about CMP speed above, I wonder if simple 0-terminated
lists would be something to consider for lower-end i386.

Alex