From: Hollis Blanchard Subject: Re: [PATCH] atomic_read Date: Fri, 11 Mar 2005 11:52:12 -0500 Message-ID: References: <6f5ce80fdc1847878df7bcd58558d7b6@cl.cam.ac.uk> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <6f5ce80fdc1847878df7bcd58558d7b6@cl.cam.ac.uk> Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Keir Fraser Cc: xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org 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