Re: [PATCH v8 15/19] locking/rwsem: Adaptive disabling of reader optimistic spinning

From: Peter Zijlstra
Date: Wed Jun 05 2019 - 16:23:27 EST


On Wed, Jun 05, 2019 at 02:13:27PM -0400, Waiman Long wrote:

> Using cmpxchg_double is actually more risky than I thought. I have been
> trying to try to use cmpxchg_double for down_write, but I kept getting
> kernel panics because the rwsem wasn't 16b-aligned. As rwsem is embedded
> in quite a large number of structures, they all have to align properly
> to make that work or the kernel will panic. That does seem too risky to
> me. So I am dropping the idea of trying to use it.

Urgh, that's another things that's been on the TODO list for a long long
time, write code to verify the alignment of allocations :/ I'm
suspecting quite a lot of that goes wrong all over the place.