Re: [patch] increase spinlock-debug looping timeouts (write_lockand NMI)

From: Arjan van de Ven
Date: Tue Jun 20 2006 - 09:03:57 EST



> Correct me if I'm wrong, but... a read-lock requires at most a single
> cacheline transfer per lock acq and a single per release, no matter the
> concurrency on the lock (so long as it is read only).
>
> A spinlock is going to take more. If the hardware perfectly round-robins
> the cacheline, it will take lockers+1 transfers per lock+unlock.

This is a bit too simplistic view; shared cachelines are cheap, it's
getting the cacheline exclusive (or transitioning to/from exclusive)
that is the expensive part...

(note that our spinlocks are fixed nowadays to only do the slowpath side
of things for read, eg allow shared cachelines there)


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