On Thu, Aug 31, 2017 at 11:50:23AM +0200, Maxime Coquelin wrote: > Prior to this patch, iotlb cache's read/write lock was > read-locked at every guest IOVA to app VA translation, > i.e. at least once per packet with indirect off and twice > with indirect on. > > The problem is that rte_rwlock_read_lock() makes use of atomic > operation, which is costly. > > This patch introduces iotlb lock helpers, so that a full burst > can be protected with taking the lock once, which reduces the > number of atomic operations by up to 64 with indirect > descriptors.
You were assuming there is no single miss during a burst. If a miss happens, it requries 2 locks: one for _pending_miss and another one for _pending_insert. From this point of view, it's actually more expensive. However, I won't call it's a bad assumption (for the case of virtio PMD). And if you take this assumption, why not just deleting the pending list and moving the lock outside the _iotlb_find function() like what you did in this patch? I don't really see the point of introducing the pending list. --yliu