From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: "Xen-Devel (E-mail)" <xen-devel@lists.xensource.com>
Subject: Re: atomic counters larger than 24 bits?
Date: Fri, 27 Mar 2009 11:15:29 -0700 [thread overview]
Message-ID: <49CD17C1.4070504@goop.org> (raw)
In-Reply-To: <aa4cfdc9-285e-4ff0-8b51-c3de728135cd@default>
Dan Magenheimer wrote:
> 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".
>
Old sparcs had no way to implement proper atomics, so they used to
reserve a byte in the atomic_t as a spinlock. But I don't think that's
true any more; they have a separate lock hash, and atomics in the kernel
are at least 32-bits.
> First, are the comments true in the xen implementation?
> (I don't see any code that restricts them to anything less
> than "int".) If they ARE limited to 24 bits, what's the
> recommended approach for larger atomic operations... or
> do I just need to always use a lock?
>
I don't think the limitation ever applied to Xen.
J
prev parent reply other threads:[~2009-03-27 18:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-26 19:38 atomic counters larger than 24 bits? Dan Magenheimer
2009-03-26 23:26 ` Samuel Thibault
2009-03-27 8:52 ` Keir Fraser
2009-03-27 18:15 ` Jeremy Fitzhardinge [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49CD17C1.4070504@goop.org \
--to=jeremy@goop.org \
--cc=dan.magenheimer@oracle.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.