[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCHv2 3/5] evtchn: use a per-event channel lock for sending events
On 16/06/15 10:18, Jan Beulich wrote: >>>> On 15.06.15 at 17:48, <david.vrabel@xxxxxxxxxx> wrote: >> @@ -609,21 +662,18 @@ int evtchn_send(struct domain *ld, unsigned int lport) >> struct domain *rd; >> int rport, ret = 0; >> >> - spin_lock(&ld->event_lock); >> - >> - if ( unlikely(!port_is_valid(ld, lport)) ) >> - { >> - spin_unlock(&ld->event_lock); >> + if ( unlikely(lport >= read_atomic(&ld->valid_evtchns)) ) >> return -EINVAL; >> - } > > I don't think you really want to open code part of port_is_valid() > (and avoid other parts of it) here? Or if really so, I think a comment > should be added to explain it. The ld->valid_evtchns is the only field we can safely check without ld->event_lock. We do check the channel state and the code that set this state uses the full port_is_valid() call. I'll add a comment. > And then - no change to free_xen_event_channel()? It looked alright to me, but now I see the clear of xen_consumer needs to be done under the channel lock. Probably by moving it to __evtchn_close(). David _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |