Messages in this thread | | | Date | Tue, 10 Oct 2006 17:17:38 -0400 (EDT) | From | Steven Rostedt <> | Subject | RE: [PATCH] Fix WARN_ON / WARN_ON_ONCE regression |
| |
On Wed, 11 Oct 2006, Ananiev, Leonid I wrote:
> Steven Rostedt wrote: > > Holy crap! I wonder where else in the kernel gcc is doing this. > Jeremy Fitzhardinge wrote: > > annotation which makes gcc consider writes to the variable relatively > expensive > > I should underline that cache miss is a result of invalidating of cache > line with __warn_once in each other CPUs performed by hw for cache > coherence. > __warn_once is a common data. It is costly to test-and-modify it just in > SMP. But it is not costly to write to the variable in memory just after > reading it. As a compiler have understood source code. > A read-and-modify for common variable are performed under lock usually. >
In todays world, SMP is becoming more and more common (still waiting to get that DualCore cell phone). So that means that writing to a variable is going to carry more weight than it use to, and gcc needs to take note of this. So, to avoid a short condition jump by adding a write to memory, is not going to save anying.
Maybe gcc just needs to have an option to "optimize" for SMP.
-- Steve
- 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/
| |