|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] evtchn/Flask: pre-allocate node on send path
Hi Jan, On 25/09/2020 14:58, Jan Beulich wrote: On 25.09.2020 15:16, Julien Grall wrote:Hi Jan, On 25/09/2020 13:21, Jan Beulich wrote:On 25.09.2020 12:34, Julien Grall wrote:On 24/09/2020 11:53, Jan Beulich wrote:xmalloc() & Co may not be called with IRQs off, or else check_lock() will have its assertion trigger about locks getting acquired inconsistently. Re-arranging the locking in evtchn_send() doesn't seem very reasonable, especially since the per-channel lock was introduced to avoid acquiring the per-domain event lock on the send paths. Issue a second call to xsm_evtchn_send() instead, before acquiring the lock, to give XSM / Flask a chance to pre-allocate whatever it may need. Maybe this is the first question we need to answer? AFAICT, we don't need send_guest_global_virq() and evtchn_send() to be mutually exclusive. Is that correct?Yes, any number of sends (even to the same port) could in principle run concurrently, I think. Or else the FIFO code would have been broken from the very point where the per-channel lock was introduced and acquiring of the per-domain one then dropped from evtchn_send() (other sending paths weren't using the per-domain one anyway already before that).So how about splitting the lock in two? One would be used when the interrupts have to be disabled while the other would be used when we can keep interrupts enabled.Now that's an interesting proposal. I thought one lock per channel was already pretty fine-grained. Now you propose making it two.The two locks would have to be taken when the event channel needs to be modified.Requiring a total of 6 locks to be acquired when fiddling with interdomain channels... Wow. Definitely more intrusive overall than the change here. Well hacks are always more self-contained but long term they are a nightmare to maintain :). 6 locks is indeed a lot, but the discussion here shows that the current locking is probably not suitable for the current uses. I don't have a better solution so far, but I will have a think about it. Meanwhile, it would be good to figure out why xsm_evtchn_send() is needed. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |