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

Re: [Xen-devel] [PATCH v6 4/5] VT-d: Reduce spin timeout to 1ms, which can be boot-time changed



>>> On 04.03.16 at 01:11, <dario.faggioli@xxxxxxxxxx> wrote:
> On Wed, 2016-03-02 at 22:31 +0800, Quan Xu wrote:
>> @@ -167,10 +176,12 @@ static int queue_invalidate_wait(struct iommu
>> *iommu,
>>          start_time = NOW();
>>          while ( poll_slot != QINVAL_STAT_DONE )
>>          {
>> -            if ( NOW() > (start_time + DMAR_OPERATION_TIMEOUT) )
>> +            if ( NOW() > (start_time + IOMMU_QI_TIMEOUT) )
>>
> Since this now involves a time unit conversion, can't we:
>  - instead of start_time, above, compute, once and for all:
>      timeout = NOW() + IOMMU_QI_TIMEOUT;
>  - check whether ( NOW() > timeout )
> 
> I appreciate that the default for vtd_qi_timeout is 1, so it's most
> likely not that a big deal, but it still looks better to me.

The code might look a little neater, but it really isn't relevant from
a performance pov: We're trying to lose time here anyway.

>>              {
>>                  print_qi_regs(iommu);
>> -                panic("queue invalidate wait descriptor was not
>> executed");
>> +                printk(XENLOG_WARNING VTDPREFIX
>> +                       "Queue invalidate wait descriptor was
>> timeout.\n");
>>
> "Queue invalidate wait descriptor timed out"  ?

Indeed - Quan, I'm sure Kevin and/or I have been mentioning this
before. If not for this specific instance, then for another one, in
which case I'd like to remind you to apply review comments not
just to the single instance they're being given for.

Jan


_______________________________________________
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®.