[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] RE: event delay issue on SMP machine when xen0 is SMP enabled



>> BTW, why vcpu other than vcpu0 won't handle event by default?
>
>We could allow any vcpu to process any pending notifications. It would 
>mean vcpus outside an irq's affinity set could end up processing an 
>interrupt and I'm not sure if that's a good thing. It would actually 
>slightly simplify evtchn.c though (no need to apply a per-cpu mask to 
>the event-channel port array).
>

I have a question on the following function, why l1 is updated only one
time, while l2 is updated in each loop? I think they should handle in
the same way. Anyway, in current code, l2 &= ~(1UL << l2i); is not
needed.
Thanks
-Xin

/* NB. Interrupts are disabled on entry. */
asmlinkage void evtchn_do_upcall(struct pt_regs *regs)
{
        unsigned long  l1, l2;
        unsigned int   l1i, l2i, port;
        int            irq, cpu = smp_processor_id();
        shared_info_t *s = HYPERVISOR_shared_info;
        vcpu_info_t   *vcpu_info = &s->vcpu_info[cpu];

        vcpu_info->evtchn_upcall_pending = 0;

        /* NB. No need for a barrier here -- XCHG is a barrier on x86.
*/
        l1 = xchg(&vcpu_info->evtchn_pending_sel, 0);
        while (l1 != 0) {
                l1i = __ffs(l1);
                l1 &= ~(1UL << l1i);
        
                while ((l2 = active_evtchns(cpu, s, l1i)) != 0) {
                        l2i = __ffs(l2);
                        l2 &= ~(1UL << l2i);
            
                        port = (l1i * BITS_PER_LONG) + l2i;
                        if ((irq = evtchn_to_irq[port]) != -1)
                                do_IRQ(irq, regs);
                        else
                                evtchn_device_upcall(port);
                }
        }
}

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.