From: Keir Fraser Subject: Re: atomic counters larger than 24 bits? Date: Fri, 27 Mar 2009 08:52:44 +0000 Message-ID: References: <20090326232627.GG5458@const.famille.thibault.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20090326232627.GG5458@const.famille.thibault.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Samuel Thibault , Dan Magenheimer Cc: "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org On 26/03/2009 23:26, "Samuel Thibault" wrote= : > Dan Magenheimer, le Thu 26 Mar 2009 19:38:13 +0000, a =E9crit : >> In tmem, I have some counters that I need to keep coherent, >> preferably without a lock, so I'm using atomic_inc/dec etc. >> However the comments in include/asm-x86/atomic.h say repeatedly >> that the "useful range of an atomic_t is only 24 bits". >=20 > IIRC the historical reason for this is that some Linux architectures > weren't providing more. The x86 implementation does support signed 32 > bits. I believe the ia64 implementation does too. Yes, I'll fix the x86/atomic.h comments. Our atomic_t type is signed and at least 32 bits. I don't see we'll ever port to an architecture without cmpxchg or similar to easily support 'full width' atomic_t. -- Keir