Re: [Patch v2 3/3] iommu: avoid taking iova_rbtree_lock twice

2019-11-29 Thread Cong Wang
On Fri, Nov 29, 2019 at 5:34 AM John Garry wrote: > > On 29/11/2019 00:48, Cong Wang wrote: > > Both find_iova() and __free_iova() take iova_rbtree_lock, > > there is no reason to take and release it twice inside > > free_iova(). > > > > Fold them into the critical section by calling the unlock >

Re: [Patch v2 3/3] iommu: avoid taking iova_rbtree_lock twice

2019-11-29 Thread John Garry
On 29/11/2019 00:48, Cong Wang wrote: Both find_iova() and __free_iova() take iova_rbtree_lock, there is no reason to take and release it twice inside free_iova(). Fold them into the critical section by calling the unlock versions instead. Since generally the iova would be non-NULL, this seems

[Patch v2 3/3] iommu: avoid taking iova_rbtree_lock twice

2019-11-28 Thread Cong Wang
Both find_iova() and __free_iova() take iova_rbtree_lock, there is no reason to take and release it twice inside free_iova(). Fold them into the critical section by calling the unlock versions instead. Cc: Joerg Roedel Signed-off-by: Cong Wang --- drivers/iommu/iova.c | 8 ++-- 1 file chan