From: Kumar Gala <galak@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH RFC] powerpc: Implement atomic64_t for 32-bit processors
Date: Fri, 12 Jun 2009 09:04:52 -0500 [thread overview]
Message-ID: <55D4E406-B6C5-471F-B7FF-86106CCC0ABF@kernel.crashing.org> (raw)
In-Reply-To: <18994.17381.129339.162342@cargo.ozlabs.ibm.com>
On Jun 12, 2009, at 7:02 AM, Paul Mackerras wrote:
> 32-bit powerpc processors have no 64-bit atomic instructions, but we
> will
> need atomic64_t in order to support the perf_counter subsystem on 32-
> bit
> processors.
>
> This adds an implementation of 64-bit atomic operations using hashed
> spinlocks to provide atomicity. For each atomic operation, the
> address
> of the atomic64_t variable is hashed to an index into an array of 16
> spinlocks. That spinlock is taken (with interrupts disabled) around
> the
> operation, which can then be coded non-atomically within the lock.
>
> On UP, all the spinlock manipulation goes away and we simply disable
> interrupts around each operation. In fact gcc eliminates the whole
> atomic64_lock variable as well.
>
> Signed-off-by: Paul Mackerras <paulus@samba.org>
> ---
> Compile-tested only at this stage, which is why it's [RFC].
any reason not to make this lib/asm generic? Seems like it isn't ppc
specific.
- k
next prev parent reply other threads:[~2009-06-12 14:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 12:02 [PATCH RFC] powerpc: Implement atomic64_t for 32-bit processors Paul Mackerras
2009-06-12 14:04 ` Kumar Gala [this message]
2009-06-12 17:40 ` Kyle McMartin
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=55D4E406-B6C5-471F-B7FF-86106CCC0ABF@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).