public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Pankratov <ap@swapped.cc>
To: Andi Kleen <ak@suse.de>
Cc: acme@conectiva.com.br, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [2.6] [1/2] hlist: replace explicit checks of hlist fields w/ func calls
Date: Tue, 10 Feb 2004 22:57:43 -0800	[thread overview]
Message-ID: <4029D267.40307@swapped.cc> (raw)
In-Reply-To: <20040213231407.208204c4.ak@suse.de>



Andi Kleen wrote:

> On Tue, 10 Feb 2004 22:28:11 -0800
> Alex Pankratov <ap@swapped.cc> wrote:
> 
> 
>>Second patch removes if's from hlist_xxx() functions. The idea
>>is to terminate the list not with 0, but with a pointer at a
>>special 'null' item. Luckily a single 'null' can be shared
>>between all hlists _without_ any synchronization, because its
>>'next' and 'pprev' fields are never read. In fact, 'next' is
>>not accessed at all, and 'pprev' is used only for writing.
> 
> I disagree with this change. The problem is that in a loop
> you need a register now to store the terminating element
> and compare to it instead of just testing for zero. This can generate 
> much worse code  on register starved i386 than having the conditional.

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.

Alex



  reply	other threads:[~2004-02-11  6:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-11  6:28 [PATCH] [2.6] [1/2] hlist: replace explicit checks of hlist fields w/ func calls Alex Pankratov
2004-02-13 22:14 ` Andi Kleen
2004-02-11  6:57   ` Alex Pankratov [this message]
2004-02-11 12:10     ` Arnaldo Carvalho de Melo
2004-02-14  0:28     ` Andi Kleen
2004-02-11 16:37       ` Alex Pankratov
2004-02-12  4:52       ` Alex Pankratov
2004-02-12  8:43         ` Andi Kleen

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=4029D267.40307@swapped.cc \
    --to=ap@swapped.cc \
    --cc=acme@conectiva.com.br \
    --cc=ak@suse.de \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox