Re: [PATCH 5/5] remove HAVE_ARCH_CMPXCHG

From: Russell King
Date: Wed Sep 14 2005 - 17:05:06 EST


On Thu, Sep 15, 2005 at 02:49:58AM +1000, Nick Piggin wrote:
> Roman Zippel wrote:
> > Hi,
> >
> > On Thu, 15 Sep 2005, Nick Piggin wrote:
> >
> >
> >>Is there any point in keeping this around?
> >
> >
> > Yes, for drivers which want to use it to synchronize with userspace.
> > Alternatively it could be changed into a Kconfig definition.
> >
>
> I think it already is. At least, I did grep for it and didn't
> see anything.
>
> I think userspace synchronization may be quite a valid use of
> atomic cmpxchg, but Kconfig is a far better place to do it than
> testing HAVE_ARCH_CMPXCHG.

What business has userspace got of telling whether cmpxchg works on
an architecture by looking at kernel headers?

Even if an architecture provides an implementation of it, it might
rely on turning IRQs off, which may not be possible in userspace,
leading to the userspace version actually being non-atomic.

*Forget* kernel includes telling userspace what architecture
features are available. It's extremely buggy by design.

If you want to remove HAVE_ARCH_CMPXCHG that's fine. If userspace
complains, you've found a bug for them. 8)

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/