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

Re: [Xen-devel] [PATCH 6/7] x86/viridian: make the threshold for HvNotifyLongSpinWait tunable



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: 20 March 2017 12:26
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
> Cc: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>; xen-
> devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH 6/7] x86/viridian: make the threshold for
> HvNotifyLongSpinWait tunable
> 
> >>> On 17.03.17 at 10:57, <paul.durrant@xxxxxxxxxx> wrote:
> > --- a/xen/arch/x86/hvm/viridian.c
> > +++ b/xen/arch/x86/hvm/viridian.c
> > @@ -22,6 +22,12 @@
> >  #include <public/sched.h>
> >  #include <public/hvm/hvm_op.h>
> >
> > +#define VIRIDIAN_SPINLOCK_RETRY_COUNT_DEFAULT 2047
> > +
> > +static int __read_mostly viridian_spinlock_retry_count;
> 
> Why don't you simply initialized the variable to 2047? None of ...
> 

I wasn't sure whether that was ok in Xen. I was following other code (mainly 
from grant table) as a template.
I'll change to using an initializer and drop the __initcall.

  Paul

> > @@ -991,6 +1003,16 @@ static int viridian_load_vcpu_ctxt(struct domain
> *d, hvm_domain_context_t *h)
> >  HVM_REGISTER_SAVE_RESTORE(VIRIDIAN_VCPU,
> viridian_save_vcpu_ctxt,
> >                            viridian_load_vcpu_ctxt, 1, HVMSR_PER_VCPU);
> >
> > +static int __init viridian_init(void)
> > +{
> > +    if ( !viridian_spinlock_retry_count )
> > +        viridian_spinlock_retry_count =
> > +            VIRIDIAN_SPINLOCK_RETRY_COUNT_DEFAULT;
> > +
> > +    return 0;
> > +}
> > +__initcall(viridian_init);
> 
> ... this would be needed then (and zero, while a useless value,
> isn't being named invalid by the spec afaics).
> 
> Jan


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

 


Rackspace

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