public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: Daniel Walker <dwalker@mvista.com>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, hzhong@gmail.com
Subject: Re: [PATCH] Profile likely/unlikely macros
Date: Wed, 26 Apr 2006 20:07:47 +1000	[thread overview]
Message-ID: <444F4673.7060702@yahoo.com.au> (raw)
In-Reply-To: <20060426095602.GB29108@wohnheim.fh-wedel.de>

Jörn Engel wrote:

> Admitted, I'm a bit slow at times.  But why does this matter?
> According to my fairly limited brain, you take a potentially expensive
> barrier, so you pay with a bit of runtime.  What you buy is a smaller
> critical section, so you can save some runtime on other cpus.  When
> optimizing for the common case, which is one cpu, this is a net loss.
> 
> There must be some correctness issue hidden that I cannot see.  Can
> you explain that to me?

Another CPU may find the bit clear, enter the critical section,
and load the old `likeliness_head' (value before being changed
by this CPU).

Then it stores the old value to likeliness->next, and overwrites
likeliness_head.

One CPU's update has now gotten lost.

(there are probably other examples, like missing likliness->type)

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

  reply	other threads:[~2006-04-26 16:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-25  2:57 [PATCH] Profile likely/unlikely macros Daniel Walker
2006-04-25  3:06 ` Andrew Morton
2006-04-25  3:17   ` Daniel Walker
2006-04-25 10:11   ` Nick Piggin
2006-04-25 18:06     ` Hua Zhong
2006-04-25 18:23     ` Daniel Walker
2006-04-26  1:08       ` Nick Piggin
2006-04-26  9:56         ` Jörn Engel
2006-04-26 10:07           ` Nick Piggin [this message]
2006-04-25 23:14     ` Chen, Kenneth W
2006-04-25  9:19 ` Andreas Mohr
2006-05-01 22:05 ` Roland Dreier
  -- strict thread matches above, loose matches on Subject: below --
2006-04-25  9:15 Mikael Pettersson

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=444F4673.7060702@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=dwalker@mvista.com \
    --cc=hzhong@gmail.com \
    --cc=joern@wohnheim.fh-wedel.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