Re: [PATCH/RFC] z3fold: use per-page read/write lock
From: Andi Kleen
Date: Mon Nov 07 2016 - 11:07:18 EST
> I understand the reinvention part but you're not quite accurate here
> with the numbers.
>
> E. g. on x86_64:
> (gdb) p sizeof(rwlock_t)
> $1 = 8
I was talking about spinlocks which are 4 bytes. Just use a spinlock then.
rwlocks are usually a bad idea anyways because they often scale far worse than
spinlocks due to the bad cache line bouncing behavior, and it doesn't
make much difference unless your critical section is very long.
-Andi