[lkml]   [2006]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] WorkStruct: Implement generic UP cmpxchg() where an arch doesn't support it

On Thu, 7 Dec 2006, Roman Zippel wrote:
> On Wed, 6 Dec 2006, Matthew Wilcox wrote:
> > To be honest, it'd be much easier if we only defined these operations on
> > atomic_t's. We have all the infrastructure in place for them, and
> > they're fairly well understood. If you need different sizes, I'm OK
> > with an atomic_pointer_t, or whatever.
> FWIW Seconded.

I disagree.

Any _real_ CPU will simply never care about _anything_ else than just the
size of the datum in question. There's absolutely no point to only allow
it on certain types, especially as we _know_ those certain types are
already going to be more than one, and we also know that they are going to
be different sizes. In other words, in reality, we have to handle a
sizeable subset of the whole generic situation, and the "on certain types
only" situation is only going to be awkward and irritating.

For example, would we have a different "cmpxchg_ptr()" function for the
atomic pointer thing? With any reasonable CPU just depending on the _size_
of the type, I don't see what the problem is with just doing the
bog-standard "cmpxchg_8/16/32/64" and having the bog-standard case-
statement in a header file to do it all automatically for you, and then we
don't need to worry about it.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2009-11-18 23:46    [W:0.075 / U:2.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site