All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: "Zhang, Yang Z" <yang.z.zhang@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Cc: "Li, LiangX Z" <liangx.z.li@intel.com>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	"'Jan Beulich (JBeulich@suse.com)'" <JBeulich@suse.com>
Subject: Re: VT-d flush timeout
Date: Mon, 18 Aug 2014 10:47:10 +0100	[thread overview]
Message-ID: <53F1CB9E.5070705@citrix.com> (raw)
In-Reply-To: <A9667DDFB95DB7438FA9D7D576C3D87E0AB66BAC@SHSMSX104.ccr.corp.intel.com>

On 18/08/14 03:01, Zhang, Yang Z wrote:
> Hi all
>
> This is continuing with previous discussion about VT-d spin loop. According previous discussion, we will deal with current 1 second flush timeout firstly.
>
> After reviewing Linux IOMMU code, it uses the timeout mechanism widely, e.g., flush iotlb and context via register based mechanism,
> __iommu_flush_context():
>     /* Make sure hardware complete it */
>     IOMMU_WAIT_OP(iommu, DMAR_CCMD_REG,
>        dmar_readq, (!(val & DMA_CCMD_ICC)), val);
>
> The only place it doesn't use this timeout mechanism is queue based invalidation. I think the reason is that the max number of queue entry is 2^15 and we don't know how much time is needed really to flush 2^15 entries. So it is better to not use timeout here. Likewise, for Xen side, we will only remove the timeout in qi flush function and use spin for instead. 
>
> Any comments?

Waiting 1 second for a timeout is quite antisocial, although as a
panic() is the result, the system wasn't going to stay alive anyway.

However, synchronously waiting for flush is not acceptable.  As
identified in the Citrix/Intel monthly meetings, there is hardware which
takes milliseconds to reply to a flush.  This is a meaningful fraction
of the default scheduling timeslice.

It is my strong opinion that all spin loops like this need to be made
asynchronous, unless we know for certain that there is an upper bound
measured in a very small quantity of microseconds, where rescheduling
another vcpu might be a poor decision.

~Andrew

  reply	other threads:[~2014-08-18  9:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18  2:01 VT-d flush timeout Zhang, Yang Z
2014-08-18  9:47 ` Andrew Cooper [this message]
2014-08-18 12:48 ` Jan Beulich
2014-08-19  1:34   ` Zhang, Yang Z
2014-08-19 13:02     ` Jan Beulich
2014-08-21  3:16       ` Zhang, Yang Z
2014-08-22  7:33         ` Jan Beulich
2014-08-22  7:49           ` Zhang, Yang Z
2014-08-22  7:58             ` Jan Beulich
2014-08-22  8:05               ` Zhang, Yang Z
2014-08-25 17:21                 ` Dugger, Donald D
2014-09-25  1:02       ` Dong, Eddie
2014-09-25  8:55         ` Jan Beulich
2014-09-25 10:44           ` Andrew Cooper
2014-09-25 10:55             ` Jan Beulich
2014-09-25 10:56               ` Andrew Cooper
2014-09-25 11:48                 ` Jan Beulich
2014-09-25 21:21                   ` Tian, Kevin
2014-09-25 23:23           ` Dong, Eddie
2014-09-26  1:07             ` Zhang, Yang Z
2014-09-26  6:30             ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F1CB9E.5070705@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=kevin.tian@intel.com \
    --cc=liangx.z.li@intel.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yang.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.