Re: [PATCH] 2.4.18-pre9, trylock for read/write semaphores

Brian J. Watson (Brian.J.Watson@compaq.com)
Tue, 12 Feb 2002 17:47:11 -0800


Alan Cox wrote:
>
> > + new = old + RWSEM_ACTIVE_READ_BIAS;
> > + if (cmpxchg(&sem->count, old, new) == old)
> > + return 1;
>
> cmpxchg isnt present on i386

According to arch/i386/config.in, the generic spinlock version would be
used for vintage 386 chips. I think that's due to similar concerns about
the xadd instruction.

-- 
Brian Watson                | "Now I don't know, but I been told it's
Linux Kernel Developer      |  hard to run with the weight of gold,
Open SSI Clustering Project |  Other hand I heard it said, it's
Compaq Computer Corp        |  just as hard with the weight of lead."
Los Angeles, CA             |     -Robert Hunter, 1970

mailto:Brian.J.Watson@compaq.com http://opensource.compaq.com/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/