|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/4] xen/spinlocks: in debug builds store cpu holding the lock
On 08.08.19 08:58, Jan Beulich wrote: On 07.08.2019 16:31, Juergen Gross wrote:--- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -13,9 +13,9 @@static atomic_t spin_debug __read_mostly = ATOMIC_INIT(0); -static void check_lock(struct lock_debug *debug) I wanted to be consistent with the type used in the structure. I can switch to bool if you like that better.
Okay. + if ( !seen.unused && seen.irq_safe == !irq_safe )While "unused" makes sufficient sense here, ...--- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -7,14 +7,20 @@ #include <xen/percpu.h>#ifndef NDEBUG Yes, that seems to be the better choice. + unsigned short irq_safe:1; + unsigned short pad:2; + unsigned short cpu:12; + }; };Do we have an implied assumption somewhere that unsigned short is exactly 16 bits wide? I think "val" wants to be uint16_t here (as you really mean "exactly 16 bits"), the two boolean fields want to be bool, and the remaining two ones unsigned int. But that would increase the size of the union to 4 bytes instead of 2. So at least pad and cpu must be unsigned short or (better) uint16_t. Juergen _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |