> -----Original Message-----
> From: Jan Beulich [mailto:jbeul...@suse.com]
> Sent: Monday, May 23, 2016 8:36 PM
> To: Wu, Feng <feng...@intel.com>
> Cc: andrew.coop...@citrix.com; dario.faggi...@citrix.com;
> george.dun...@eu.citrix.com; Tian, Kevin <kevin.t...@intel.com>; xen-
> de...@lists.xen.org; konrad.w...@oracle.com; k...@xen.org
> Subject: Re: [PATCH 3/3] VMX: Remove the vcpu from the per-cpu blocking list
> after domain termination
> 
> >>> On 20.05.16 at 10:53, <feng...@intel.com> wrote:
> > --- a/xen/arch/x86/hvm/vmx/vmx.c
> > +++ b/xen/arch/x86/hvm/vmx/vmx.c
> > @@ -248,6 +248,36 @@ void vmx_pi_hooks_deassign(struct domain *d)
> >      d->arch.hvm_domain.vmx.pi_switch_to = NULL;
> >  }
> >
> > +static void vmx_pi_blocking_list_cleanup(struct domain *d)
> > +{
> > +    unsigned int cpu;
> > +
> > +    for_each_online_cpu ( cpu )
> > +    {
> > +        struct vcpu *v;
> > +        unsigned long flags;
> > +        struct arch_vmx_struct *vmx, *tmp;
> > +        spinlock_t *lock = &per_cpu(vmx_pi_blocking, cpu).lock;
> > +        struct list_head *blocked_vcpus = &per_cpu(vmx_pi_blocking, 
> > cpu).list;
> > +
> > +        spin_lock_irqsave(lock, flags);
> > +
> > +        list_for_each_entry_safe(vmx, tmp, blocked_vcpus, pi_blocking.list)
> > +        {
> 
> Did you consider how long these two nested loops may take on a
> large system?
> 

As Dario just mentioned, we may not need this loop at all.

Thanks,
Feng

> Jan


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

Reply via email to