[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] atomic_read



On Mar 11, 2005, at 10:53 AM, Keir Fraser wrote:

On 11 Mar 2005, at 14:57, Hollis Blanchard wrote:

Hi, I noticed that include/xen/sched.h uses _atomic_*() in a couple places, while all other Xen code uses atomic_*(). In general I think functions prefixed with an underscore are not part of the public interface...

This patch should be safe since atomic_*() just use volatile and _atomic_*() do not.

Side note: the Xen copy of atomic.h appears to be a little out of date with respect to the Linux 2.6.11 version, in which _atomic_*() is no longer present (only atomic_*() are).

The xen _atomic_* functions aren't like the old Linux ones -- they don't take a pointer to the atomic_t. We use this in the scheduler to produce better-quality code. The patch you sent won't compile because e.g., atomic_set and _atomic_set take different type parameters.

Ahh... I assumed asm-x86/atomic.h was simply out of date, but I see now that you've modified it yourself. So _atomic_* should now be considered part of the arch->common interface? Further, it should actually *not* be an atomic access at all? Of course it will be faster ("better-quality") code if it's not assumed to be an atomic access... in which case isn't the naming a little misleading?

I noticed this problem because linux/include/asm-ppc64/atomic.h doesn't have _atomic_* functions. I guess this means I will need to implement my own non-atomic _atomic_* functions?

--
Hollis Blanchard
IBM Linux Technology Center



-------------------------------------------------------
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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.