On 14.03.2024 08:20, Juergen Gross wrote: > Recursive and normal spinlocks are sharing the same data structure for > representation of the lock. This has two major disadvantages: > > - it is not clear from the definition of a lock, whether it is intended > to be used recursive or not, while a mixture of both usage variants > needs to be > > - in production builds (builds without CONFIG_DEBUG_LOCKS) the needed > data size of an ordinary spinlock is 8 bytes instead of 4, due to the > additional recursion data needed (associated with that the rwlock > data is using 12 instead of only 8 bytes) > > Fix that by introducing a struct spinlock_recursive for recursive > spinlocks only, and switch recursive spinlock functions to require > pointers to this new struct. > > This allows to check the correct usage at build time. > > Signed-off-by: Juergen Gross <[email protected]>
Reviewed-by: Jan Beulich <[email protected]>
