Re: [linux-usb-devel] Re: [PATCH 00/10] usb-serial: Switches fromspin lock to atomic_t.

From: Arjan van de Ven
Date: Wed Dec 07 2005 - 11:02:05 EST



> > No they're not. Both are just about equally expensive cpu wise,
> > sometimes the atomic_t ones are a bit more expensive (like on parisc
> > architecture). But on x86 in either case it's a locked cycle, which is
> > just expensive no matter which side you flip the coin...
>
> But if a lock is used exclusively to protect a int variable, an atomic_t
> seems to be more appropriate to me. Isn't it?

sounds like it...

> Please, if you could, review the patches with this in mind: we aren't
> changing any behaviour neither creating any weird lock scheme, we are
> only doing two things:

... however you are NOT changing the behavior, which is EXACTLY my
point; the current "lock emulation" behavior is wrong, all you're doing
is replacing how you do the wrong thing ;)

It's like having a bike with square wheels, and replacing a flat tire
with one with air in, as opposed to replacing it with a round wheel...


-
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/