On 08.09.2022 09:46, Juergen Gross wrote: > Add checking of lock recursion to the hypervisor. This is done by using > a percpu data array for storing the address of each taken lock. Any > attempt to take a lock twice (with the exception of recursive > spinlocks) will result in a crash. This is especially meant for > detecting attempts to take a rwlock multiple times as a reader, which > will only result in a deadlock in case of another cpu trying to get the > lock as a writer in between. > > The additional checks are not performance neutral, so they are enabled > only in debug builds per default, as the checks are active only with > CONFIG_DEBUG_LOCKS enabled. The size of the percpu data array can be > selected via a boot parameter. > > Signed-off-by: Juergen Gross <[email protected]> > --- > Further possible enhancements: > - record address or file/line of locker, too > - add sanity check when exiting hypervisor or going to idle that all locks > have been released > > Signed-off-by: Juergen Gross <[email protected]>
Reviewed-by: Jan Beulich <[email protected]> But left in the queue for 4.18, ftaod. Jan
