lkml.org 
[lkml]   [2006]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Profile likely/unlikely macros
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-26 18:38    [W:0.045 / U:2.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site