All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S . Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 4/4] intel_iommu: implement mru list for iotlb
Date: Fri, 14 Jul 2017 12:32:41 +0800	[thread overview]
Message-ID: <20170714043241.GK27284@pxdev.xzpeter.org> (raw)
In-Reply-To: <0850f338-98a2-614a-c8bd-3407c9b5a485@redhat.com>

On Thu, Jul 13, 2017 at 04:48:42PM +0800, Jason Wang wrote:
> 
> 
> On 2017年07月12日 16:13, 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.
> >
> >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.
> >
> >After we have such a MRU list, replacing all the iterators of IOTLB
> >entries by using list iterations rather than hash table iterations.
> 
> Any reason of doing this, I thought hashtable was even a little bit faster?

Could I ask why?

I thought they are merely the same (when iterating all the items)?

-- 
Peter Xu

  reply	other threads:[~2017-07-14  4:41 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 [this message]
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

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=20170714043241.GK27284@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.