Re: [Xen-devel] [PATCH v5 1/5] xen/spinlocks: in debug builds store cpu holding the lock

2019-09-12 Thread Jan Beulich
On 12.09.2019 15:42, Juergen Gross wrote: > On 12.09.19 15:36, Jan Beulich wrote: >> On 12.09.2019 15:28, Juergen Gross wrote: >>> @@ -267,6 +288,7 @@ int _spin_trylock_recursive(spinlock_t *lock) >>> >>> /* Don't allow overflow of recurse_cpu field. */ >>> BUILD_BUG_ON(NR_CPUS >

Re: [Xen-devel] [PATCH v5 1/5] xen/spinlocks: in debug builds store cpu holding the lock

2019-09-12 Thread Juergen Gross
On 12.09.19 15:36, Jan Beulich wrote: On 12.09.2019 15:28, Juergen Gross wrote: @@ -267,6 +288,7 @@ int _spin_trylock_recursive(spinlock_t *lock) /* Don't allow overflow of recurse_cpu field. */ BUILD_BUG_ON(NR_CPUS > SPINLOCK_NO_CPU); +BUILD_BUG_ON(SPINLOCK_RECURSE_BITS <=

Re: [Xen-devel] [PATCH v5 1/5] xen/spinlocks: in debug builds store cpu holding the lock

2019-09-12 Thread Jan Beulich
On 12.09.2019 15:28, Juergen Gross wrote: > @@ -267,6 +288,7 @@ int _spin_trylock_recursive(spinlock_t *lock) > > /* Don't allow overflow of recurse_cpu field. */ > BUILD_BUG_ON(NR_CPUS > SPINLOCK_NO_CPU); > +BUILD_BUG_ON(SPINLOCK_RECURSE_BITS <= 0); This is too weak: While I

[Xen-devel] [PATCH v5 1/5] xen/spinlocks: in debug builds store cpu holding the lock

2019-09-12 Thread Juergen Gross
Add the cpu currently holding the lock to struct lock_debug. This makes analysis of locking errors easier and it can be tested whether the correct cpu is releasing a lock again. Signed-off-by: Juergen Gross --- V2: - adjust types (Jan Beulich) V4: - add define for bitfield size to store cpu