[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1IIwQx-000468-00@gondolin.me.apana.org.au>
Date: Thu, 09 Aug 2007 09:03:27 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: csnook@...hat.com (Chris Snook)
Cc: akpm@...ux-foundation.org, torvalds@...ux-foundation.org,
ak@...e.de, heiko.carstens@...ibm.com, davem@...emloft.net,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
schwidefsky@...ibm.com, wensong@...ux-vs.org, horms@...ge.net.au,
wjiang@...ilience.com, cfriesen@...tel.com, zlynx@....org
Subject: Re: [PATCH] make atomic_t volatile on all architectures
Chris Snook <csnook@...hat.com> wrote:
>
> Some architectures currently do not declare the contents of an atomic_t to be
> volatile. This causes confusion since atomic_read() might not actually read
> anything if an optimizing compiler re-uses a value stored in a register, which
> can break code that loops until something external changes the value of an
> atomic_t. Avoiding such bugs requires using barrier(), which causes re-loads
Such loops should always use something like cpu_relax() which comes
with a barrier.
> of all registers used in the loop, thus hurting performance instead of helping
> it, particularly on architectures where it's unnecessary. Since we generally
Do you have an example of such a loop where performance is hurt by this?
The IPVS code that led to this patch was simply broken and has been
fixed to use cpu_relax().
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists