[Top] [All Lists]

Re: Observations on LLSC and SMP

To: Ed Martini <>
Subject: Re: Observations on LLSC and SMP
From: Daniel Jacobowitz <>
Date: Fri, 25 Mar 2005 14:37:59 -0500
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <>
User-agent: Mutt/1.5.6+20040907i
On Fri, Mar 25, 2005 at 11:24:05AM -0800, Ed Martini wrote:
> 1. If the first part of the if were an ifdef instead it would result in 
> a code size reduction as well as a runtime performance gain.

You should spend a little time playing with an optimizing compiler. 
They're capable of working out when a condition will always be false.

> 2. In atomic.h the "C lang stuff" is wrapped with a spinlock.  In the 
> SMP case the spinlock will result in code that contains ll and sc 
> instructions, so I infer that there are no SMP system configs that use 
> CPUs that don't have the ll and sc instructions. 

That's correct.  It is not practical to implement SMP without a mutex

Daniel Jacobowitz
CodeSourcery, LLC

<Prev in Thread] Current Thread [Next in Thread>