All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: 32 bits as smallest atomic size.
@ 2005-03-25 21:25 Jimi Xenidis
  2005-03-25 21:30 ` Ronald G. Minnich
  2005-03-25 21:43 ` Keir Fraser
  0 siblings, 2 replies; 26+ messages in thread
From: Jimi Xenidis @ 2005-03-25 21:25 UTC (permalink / raw)
  To: xen-devel


In PPC land we have an issue where cmpxchg operations can only be
applied to strictly aligned 32 and 64 bit quantities.

We understand on x86 the use of the packed attribute has certain
benefits, but in the common areas we believe that portability should
be the primary concern in the common code.

I can only assume that much debate will come from this as we find
alignment and size issues all over.

The particular offender at the moment is:
  include/public/grant_table.h flags 76 u16 flags;

It is used with atomic methods such as cmpxchg_user() and clear_bit().

Any thoughts on how to proceed with this would be appreciated.

-JX

BTW: is clear_bit() as implemeted for x86 have soem alignment issues?
My expertise in this space is limited.





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 26+ messages in thread
* RE: RFC: 32 bits as smallest atomic size.
@ 2005-03-29 22:00 Ian Pratt
  2005-03-29 22:32 ` Hollis Blanchard
  2005-03-30  3:24 ` Jimi Xenidis
  0 siblings, 2 replies; 26+ messages in thread
From: Ian Pratt @ 2005-03-29 22:00 UTC (permalink / raw)
  To: Hollis Blanchard, Keir Fraser; +Cc: Jimi Xenidis, xen-devel

> Right now there is a single problematic cmpxchg user, 
> grant_entry_t, and the impact of the fix is tiny (make the 
> 'flags' member 4 bytes). Is that too large an inconvenience?

That would make grant table entries 12 bytes rather than 8 bytes, which
is not ideal given that you can end up needing quite a lot of them,
particularly when the cacheline packing is considered. 

Perhaps the best thing to do would be to change that particular instance
of cmpxchg into cmpxchg_16, where we handle the subword case on
architectures which can't do it directly by rounding down the address,
doing a read, insert, and cmpxchg. 

This seems a better fix, at least to me.

Ian

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

end of thread, other threads:[~2005-03-30  3:24 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-25 21:25 RFC: 32 bits as smallest atomic size Jimi Xenidis
2005-03-25 21:30 ` Ronald G. Minnich
2005-03-25 21:43 ` Keir Fraser
2005-03-25 23:49   ` Jimi Xenidis
2005-03-26  0:02     ` Keir Fraser
2005-03-26 14:13       ` Jimi Xenidis
2005-03-26 17:07         ` Keir Fraser
2005-03-29 20:16           ` Kurt Garloff
2005-03-26 17:36         ` Ronald G. Minnich
2005-03-26 17:29     ` Ronald G. Minnich
2005-03-26 17:31       ` Jimi Xenidis
2005-03-26 17:49         ` Keir Fraser
2005-03-26 17:56           ` Keir Fraser
2005-03-26 18:46             ` Jimi Xenidis
2005-03-27  3:34             ` Ronald G. Minnich
2005-03-27 10:56               ` Keir Fraser
2005-03-27 11:19                 ` Keir Fraser
2005-03-28 15:37                   ` Ronald G. Minnich
2005-03-28 15:34                 ` Ronald G. Minnich
2005-03-27  0:27           ` David Hopwood
2005-03-27 10:49             ` Keir Fraser
2005-03-27 15:39               ` David Hopwood
2005-03-29 21:39   ` Hollis Blanchard
  -- strict thread matches above, loose matches on Subject: below --
2005-03-29 22:00 Ian Pratt
2005-03-29 22:32 ` Hollis Blanchard
2005-03-30  3:24 ` Jimi Xenidis

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.