linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFP] atomic[64]_[read|set] asm implementations
@ 2007-08-15 17:55 Chris Snook
  2007-08-15 18:43 ` Russell King
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Snook @ 2007-08-15 17:55 UTC (permalink / raw)
  To: Linux Kernel, linux-arch

In the fallout from the recent atomic_t volatility discussions, patches 
have been posted to moot the compiler correctness issues by implementing 
atomic[64]_[read|set] in inline assembly on powerpc, i386, and x86_64. 
While I personally don't consider such implementations to be critically 
necessary, they slightly reduce binary size and greatly reduce lkml 
controversy, so I like them.

I'm not an inline assembly expert, but I would welcome it if those who 
are would like to submit implementations of these functions for 
architectures they're intimately familiar with.  I'll pull them into the 
atomic_t patch set I've stumbled into shepherding, and hopefully we can 
commit something all at once that makes all architectures consistent, 
resists compiler bugs, and doesn't piss off too many people.

For architectures whose maintainers aren't worried and whose 
developers/users aren't bothered enough to submit an inline assembly 
patch, I'll just keep the inlines with the *(volatile foo *)& casts, 
unless of course ISO clarifies the C standard to different effect while 
we're arguing over semantics and micro-optimizations.

	-- Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFP] atomic[64]_[read|set] asm implementations
  2007-08-15 17:55 [RFP] atomic[64]_[read|set] asm implementations Chris Snook
@ 2007-08-15 18:43 ` Russell King
  0 siblings, 0 replies; 2+ messages in thread
From: Russell King @ 2007-08-15 18:43 UTC (permalink / raw)
  To: Chris Snook; +Cc: Linux Kernel, linux-arch

On Wed, Aug 15, 2007 at 01:55:37PM -0400, Chris Snook wrote:
> For architectures whose maintainers aren't worried and whose 
> developers/users aren't bothered enough to submit an inline assembly 
> patch, I'll just keep the inlines with the *(volatile foo *)& casts, 
> unless of course ISO clarifies the C standard to different effect while 
> we're arguing over semantics and micro-optimizations.

I have no problem with your latest patch for ARM.  Moving ARM to
assembly will actually remove some information which the compiler
has when it knows about the access to be performed.

If atomic_read() were converted to inline assembly, we'd prevent the
compiler from knowing that a load has been performed and it should
therefore avoid using the result of the load where possible for the
following few instructions (due to result delays.)

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-15 18:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 17:55 [RFP] atomic[64]_[read|set] asm implementations Chris Snook
2007-08-15 18:43 ` Russell King

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).