From: Keir Fraser Subject: Re: [rfc] [patch] grant_entry.flags accessors Date: Tue, 27 Jun 2006 17:55:06 +0100 Message-ID: <20a2a4524ce898b8fbd49cfd27c38b12@cl.cam.ac.uk> References: <1151097564.14454.44.camel@basalt.austin.ibm.com> <46ab924009436680faa7cc0cb807c411@cl.cam.ac.uk> <1151420814.31429.35.camel@basalt.austin.ibm.com> <6bd19f34d11ffa609d6650b7937fb8b0@cl.cam.ac.uk> <1151424690.31429.106.camel@basalt.austin.ibm.com> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1151424690.31429.106.camel@basalt.austin.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Hollis Blanchard Cc: xen-devel , xen-ppc-devel List-Id: xen-devel@lists.xenproject.org On 27 Jun 2006, at 17:11, Hollis Blanchard wrote: > In general I'm skeptical of blindly performing these operations on > unknown data. I think it's pretty clear that is not a good interface, > and what you're suggesting is codifying this behavior in the interface. > > More practically speaking, I would be shocked if the Linux maintainers > would accept that sort of change to their atomic interfaces. I shouldn't imagine they'd mind the interface being made more permissive, with no performance loss for the common case and no extra API complexity, but anyway: How about add a ARCH_SUPPORTS_UNALIGNED_CMPXCHG and move special gnttab_cmpxchg() definition to gnttab.c, compilation dependent on that? Or rename the gnttab_cmpxchg to synch_cmpxchg_unaligned so at least the name is a bit more generic. It could then be used in other contexts. The Xen change is okay, but gnttab_clear_flag() would be a better function name if the function is really going to be gnttab specific. Or rename to clear_bit_unaligned and move definition to bitops.h. As with synch_cmpxchg_unaligned, the new function could then be used in other contexts. -- Keir