[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] rwlock: allow recursive read locking when already locked in write mode
On 21/02/2020 14:49, Roger Pau Monné wrote: On Fri, Feb 21, 2020 at 03:41:59PM +0100, Jan Beulich wrote:Because you need to invoke smp_processor_id() to calculate the value to use in the subtraction. I'm not meaning to say I'm entirely opposed (seeing how much of a discussion we're having), but the "simple write of zero" approach is certainly appealing.Well, we could avoid the smp_processor_id() call and instead use: atomic_sub(atomic_read(&lock->cnts) & 0xffff, &lock->cnts); AFAICT, this would not be safe because the top 16-bit may change behind your back (via a read_lock). Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |