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

Re: [Xen-devel] [RFC v2 11/15] vmx: Add a global wake-up vector for VT-d Posted-Interrupts




> -----Original Message-----
> From: xen-devel-bounces@xxxxxxxxxxxxx
> [mailto:xen-devel-bounces@xxxxxxxxxxxxx] On Behalf Of Jan Beulich
> Sent: Tuesday, June 09, 2015 11:20 PM
> To: Wu, Feng
> Cc: Tian, Kevin; keir@xxxxxxx; george.dunlap@xxxxxxxxxxxxx;
> andrew.cooper3@xxxxxxxxxx; xen-devel@xxxxxxxxxxxxx; Zhang, Yang Z
> Subject: Re: [Xen-devel] [RFC v2 11/15] vmx: Add a global wake-up vector for
> VT-d Posted-Interrupts
> 
> >>> On 08.05.15 at 11:07, <feng.wu@xxxxxxxxx> wrote:
> > @@ -3262,6 +3271,28 @@ void vmx_vmenter_helper(const struct
> cpu_user_regs *regs)
> >  }
> >
> >  /*
> > + * Handle VT-d posted-interrupt when VCPU is blocked.
> > + */
> > +void pi_wakeup_interrupt(struct cpu_user_regs *regs)
> 
> static (and perhaps move it up so you don't need to forward declare it).
> 
> > +{
> > +    struct vcpu *v;
> > +    unsigned int cpu = smp_processor_id();
> > +
> > +    spin_lock(&per_cpu(blocked_vcpu_lock, cpu));
> > +    list_for_each_entry(v, &per_cpu(blocked_vcpu, cpu),
> > +                    blocked_vcpu_list) {
> 
> How long do you think such a list can grow? 

It depends on how many vCPU is current blocked on this specific pCPU.
I am not sure how long it can grow. 

The basic idea here is that, when notification wakeup event happens,
we need to find a way to find the right vCPU, and then wakeup it, do
you have any better idea for this?

Thanks,
Feng

> I'm afraid you might
> be adding quite a bit of latency here to the system.
> 
> > +        struct pi_desc *pi_desc = &v->arch.hvm_vmx.pi_desc;
> > +
> > +        if ( pi_desc->on == 1 )
> 
> Isn't this a single-bit (i.e. boolean) field? In which case - no reason
> to compare with 1.
> 
> I also don't see the value of the local variable - it's being used only
> once, and without it the line wouldn't get overly long or unreadable.
> 
> > --- a/xen/include/xen/sched.h
> > +++ b/xen/include/xen/sched.h
> > @@ -148,6 +148,8 @@ struct vcpu
> >
> >      struct vcpu     *next_in_list;
> >
> > +    struct list_head blocked_vcpu_list;
> 
> Again - why here instead of in VT-d/VMX specific structures?

Do you think it is okay to put it in " struct arch_vmx_struct" ?

Thanks,
Feng

> 
> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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