|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 11/12] evtchn: convert vIRQ lock to an r/w one
Hi Jan, On 28/09/2020 12:02, Jan Beulich wrote: There's no need to serialize all sending of vIRQ-s; all that's needed is serialization against the closing of the respective event channels (by means of a barrier). To facilitate the conversion, introduce a new rw_barrier(). Looking at the code below, all the spin_lock() have been replaced by a read_lock_*(). This is a bit surprising,
I would prefer if keep including <xen/spinlock.h> as the fact <xen/rwlock.h> include it is merely an implementation details.
Why do you need to call smp_mb() at each loop? Would not it be sufficient to write something similar to spin_barrier(). I.e: smp_mb(); while ( _rw_is_locked(lock) ) cpu_relax(); smp_mb();But I wonder if there is a risk with either implementation for _rw_is_locked() to always return true and therefore never end. Let say we receive an interrupt, by the time it is handled, the read/lock may have been taken again. spin_barrier() seems to handle this situation fine because it just wait for the head to change. I don't think we can do the same here... I am thinking that it may be easier to hold the write lock when doing the update. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |