From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Geoff Thorpe <Geoff.Thorpe@freescale.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] RFC: powerpc: expose the multi-bit ops that underlie single-bit ops.
Date: Fri, 19 Jun 2009 08:22:31 +1000 [thread overview]
Message-ID: <1245363751.8693.6.camel@pasglop> (raw)
In-Reply-To: <4A3AA3FE.8090903@freescale.com>
On Thu, 2009-06-18 at 16:30 -0400, Geoff Thorpe wrote:
> I've left the volatile qualifier in the generated API because I didn't
> feel so comfortable changing APIs, but I also added the "memory" clobber
> for all cases - whereas it seems the existing set_bits(), clear_bits(),
> [...] functions didn't declare this... Do you see any issue with having
> the 'volatile' in the prototype as well as the clobber in the asm?
>
> Actually, might as well just respond to the new patch instead... :-) Thx.
I think the story with the memory clobber is that it depends whether
we consider the functions as ordering accesses or not (ie, can
potentially be used with lock/unlock semantics).
The general rule is that those who don't return anything don't need
to have those semantics, and thus could only be advertised as clobbering
p[word] -but- there are issues there. For example, despite the
(relatively new) official _lock/_unlock variants, there's still code
that abuses constructs like test_and_set_bit/clear_bit as locks and in
that case, clear bits needs a clobber.
So I would say at this stage better safe than having to track down
incredibly hard to find bugs, and let's make them all take that clobber.
Cheers,
Ben.
next prev parent reply other threads:[~2009-06-18 22:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-26 18:19 [PATCH] RFC: powerpc: expose the multi-bit ops that underlie single-bit ops Geoff Thorpe
2009-06-16 3:53 ` Benjamin Herrenschmidt
2009-06-16 14:28 ` Geoff Thorpe
2009-06-16 21:33 ` Benjamin Herrenschmidt
2009-06-17 1:07 ` Stephen Rothwell
2009-06-18 20:30 ` Geoff Thorpe
2009-06-18 22:22 ` Benjamin Herrenschmidt [this message]
2009-06-19 3:59 ` Geoff Thorpe
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=1245363751.8693.6.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=Geoff.Thorpe@freescale.com \
--cc=linuxppc-dev@ozlabs.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).