From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: write_unlock: replace clear_bit with byte store
Date: Thu, 28 Apr 2005 20:43:14 +0000 [thread overview]
Message-ID: <17009.19170.812514.281553@napali.hpl.hp.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0504281329150.23584@schroedinger.engr.sgi.com>
>>>>> On Thu, 28 Apr 2005 13:32:35 -0700 (PDT), Christoph Lameter <clameter@engr.sgi.com> said:
Christoph> #define _raw_write_unlock(x) \
Christoph> ({ \
Christoph> - smp_mb__before_clear_bit(); /* need barrier before releasing lock... */ \
Christoph> - clear_bit(31, (x)); \
Christoph> + u8 *y = (u8 *)x; \
Christoph> + smp_wmb(); /* need barrier before releasing lock... */ \
Christoph> + y[3] = 0; \
Christoph> })
I'm unsure if it's a good idea to reduce the counter size.
Independent of that: using a name like "y" in a macro is bound to
cause name collisions so it's a big no-no. Then why not declare
"y" as a "volatile u8 *" so you can avoid the explicit smp_wmb()?
This is ia64-specific code after all.
--david
next prev parent reply other threads:[~2005-04-28 20:43 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-28 20:32 write_unlock: replace clear_bit with byte store Christoph Lameter
2005-04-28 20:43 ` David Mosberger [this message]
2005-04-28 20:53 ` Christoph Lameter
2005-04-28 22:05 ` Christoph Lameter
2005-04-28 22:25 ` Zou, Nanhai
2005-04-28 22:51 ` Christoph Lameter
2005-04-28 23:55 ` Chen, Kenneth W
2005-04-29 0:21 ` Christoph Lameter
2005-04-29 0:28 ` Chen, Kenneth W
2005-04-29 0:50 ` Christoph Lameter
2005-04-29 1:04 ` Chen, Kenneth W
2005-04-29 1:48 ` Chen, Kenneth W
2005-04-29 7:09 ` David Mosberger
2005-04-29 11:37 ` David Mosberger
2005-04-29 15:19 ` Christoph Lameter
2005-04-29 15:20 ` Christoph Lameter
2005-04-29 15:24 ` David Mosberger
2005-04-29 15:28 ` David Mosberger
2005-04-29 15:30 ` Christoph Lameter
2005-04-29 15:38 ` David Mosberger
2005-04-29 15:46 ` Christoph Lameter
2005-04-29 15:48 ` David Mosberger
2005-04-29 15:51 ` Christoph Hellwig
2005-04-29 15:55 ` Christoph Lameter
2005-04-29 16:01 ` David Mosberger
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=17009.19170.812514.281553@napali.hpl.hp.com \
--to=davidm@napali.hpl.hp.com \
--cc=linux-ia64@vger.kernel.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