qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 4/4] intel_iommu: implement mru list for iotl


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH v3 4/4] intel_iommu: implement mru list for iotlb
Date: Fri, 14 Jul 2017 15:28:09 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1



On 2017年07月14日 12:32, Peter Xu wrote:
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)?


Ok, looks like I was wrong, but it they are merely the same, why bother?

Thanks



reply via email to

[Prev in Thread] Current Thread [Next in Thread]