From: Peter Xu <peterx@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 4/4] intel_iommu: implement mru list for iotlb
Date: Fri, 14 Jul 2017 12:43:05 +0800 [thread overview]
Message-ID: <20170714044305.GL27284@pxdev.xzpeter.org> (raw)
In-Reply-To: <20170713204803-mutt-send-email-mst@kernel.org>
On Thu, Jul 13, 2017 at 08:49:44PM +0300, Michael S. Tsirkin wrote:
> On Wed, Jul 12, 2017 at 04:13:43PM +0800, Peter Xu wrote:
> > It is not wise to disgard all the IOTLB cache when cache size reaches
> > max, but that's what we do now. A slightly better (but still simple) way
> > to do this is, we just throw away the least recent used cache entry.
>
> Not wise how? Slower? It seems simpler.
When the cache is full, the cached items are still valid, but we just
throw them away. I agree it is definitely simpler, but is that really
wise?
>
> > This patch implemented MRU list algorithm for VT-d IOTLB. The main logic
> > is to maintain a Most Recently Used list for the IOTLB entries. The hash
> > table is still used for lookup, though a new list field is added to each
> > IOTLB entry for a iotlb MRU list. For each active IOTLB entry, it's both
> > in the hash table in s->iotlb, and also linked into the MRU list of
> > s->iotlb_head. The hash helps in fast lookup, and the MRU list helps in
> > knowing whether the cache is still hot.
>
> Helps how? Faster? What's missing here is a report of the performance
> impact.
Not faster, the hash is already there. This patch only tries to fix
the thing I mentioned above (not throwing valid entries when cache
full). As far as I tested (all simple ones), it does not have
performance boost since it's not easy to trigger cache full (our cache
size is 1024, not to mention that current intel iommu driver will do
very rapid global flush). I just think it makes sense, and maybe it
can help in the future when there are no that frequent iotlb flushes.
If we still require performance numbers to merge this patch, I think
we can put this patch aside, until one day we might think it useful.
Thanks,
--
Peter Xu
prev parent reply other threads:[~2017-07-14 4:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 8:13 [Qemu-devel] [PATCH v3 0/4] VT-d: some enhancements on iotlb Peter Xu
2017-07-12 8:13 ` [Qemu-devel] [PATCH v3 1/4] intel_iommu: fix VTD_PAGE_MASK Peter Xu
2017-07-13 8:41 ` Jason Wang
2017-07-14 4:27 ` Peter Xu
2017-07-12 8:13 ` [Qemu-devel] [PATCH v3 2/4] intel_iommu: let iotlb size tunable Peter Xu
2017-07-13 17:47 ` Michael S. Tsirkin
2017-07-14 4:31 ` Peter Xu
2017-07-12 8:13 ` [Qemu-devel] [PATCH v3 3/4] intel_iommu: use access_flags for iotlb Peter Xu
2017-07-12 8:13 ` [Qemu-devel] [PATCH v3 4/4] intel_iommu: implement mru list " Peter Xu
2017-07-13 8:48 ` Jason Wang
2017-07-14 4:32 ` Peter Xu
2017-07-14 7:28 ` Jason Wang
2017-07-17 1:53 ` Peter Xu
2017-07-26 20:37 ` Michael S. Tsirkin
2017-07-27 2:19 ` Peter Xu
2017-07-13 17:49 ` Michael S. Tsirkin
2017-07-14 4:43 ` Peter Xu [this message]
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=20170714044305.GL27284@pxdev.xzpeter.org \
--to=peterx@redhat.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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.