Re: [PATCH 4/5] atomic: dec_and_lock use cmpxchg

From: David S. Miller
Date: Wed Sep 14 2005 - 11:25:08 EST


From: Nick Piggin <nickpiggin@xxxxxxxxxxxx>
Date: Thu, 15 Sep 2005 00:55:45 +1000

> I noticed David posted a patch to do something similar the
> other day. With a generic atomic_cmpxchg available, such a
> patch is no longer objectionable to those architectures
> that don't #define __HAVE_ARCH_CMPXCHG
>
> Do we want this David? Any other architecture have a super
> optimised atomic_dec_and_lock that surpasses this
> implementation?

I talked to Linus about my patch and he made the good point that the
Alpha optimization is very valid (it avoids loading the GP and other
stuff by doing that fancy assembler entry point). So we decided that
we'd make the cmpxchg() generic version, but make moving over to that
gradual instead of mandatorily forcing everyone to use the new thing.

So, for example, we'd convert sparc64 (because I want to) and the
architectures using the exact same ppc64 C code, but leave the others
alone. It'd be up to the remaining platform's maintainers to move
over if they wanted to.

I'll submit that updated patch to him later today.
-
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/