Re: [Patch v2 2/3] iommu: optimize iova_magazine_free_pfns()

2019-12-03 Thread Cong Wang
On Mon, Dec 2, 2019 at 2:02 AM John Garry wrote: > > On 30/11/2019 06:02, Cong Wang wrote: > > On Fri, Nov 29, 2019 at 5:24 AM John Garry wrote: > >> > >> On 29/11/2019 00:48, Cong Wang wrote: > >>> If the maganize is empty, iova_magazine_free_pfns() should > >> > >> magazine > > > > Good catch!

Re: [Patch v2 2/3] iommu: optimize iova_magazine_free_pfns()

2019-12-03 Thread Cong Wang
On Mon, Dec 2, 2019 at 8:59 AM Christoph Hellwig wrote: > > > + return (mag && mag->size == IOVA_MAG_SIZE); > > > + return (!mag || mag->size == 0); > > No need for the braces in both cases. The current code is already this, I don't want to mix coding style changes with a non-coding-style

Re: [Patch v2 2/3] iommu: optimize iova_magazine_free_pfns()

2019-12-02 Thread Christoph Hellwig
> + return (mag && mag->size == IOVA_MAG_SIZE); > + return (!mag || mag->size == 0); No need for the braces in both cases. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [Patch v2 2/3] iommu: optimize iova_magazine_free_pfns()

2019-12-02 Thread John Garry
On 30/11/2019 06:02, Cong Wang wrote: On Fri, Nov 29, 2019 at 5:24 AM John Garry wrote: On 29/11/2019 00:48, Cong Wang wrote: If the maganize is empty, iova_magazine_free_pfns() should magazine Good catch! be a nop, however it misses the case of mag->size==0. So we should just call io

Re: [Patch v2 2/3] iommu: optimize iova_magazine_free_pfns()

2019-11-29 Thread Cong Wang
On Fri, Nov 29, 2019 at 5:24 AM John Garry wrote: > > On 29/11/2019 00:48, Cong Wang wrote: > > If the maganize is empty, iova_magazine_free_pfns() should > > magazine Good catch! > > > be a nop, however it misses the case of mag->size==0. So we > > should just call iova_magazine_empty(). > > >

Re: [Patch v2 2/3] iommu: optimize iova_magazine_free_pfns()

2019-11-29 Thread John Garry
On 29/11/2019 00:48, Cong Wang wrote: If the maganize is empty, iova_magazine_free_pfns() should magazine be a nop, however it misses the case of mag->size==0. So we should just call iova_magazine_empty(). This should reduce the contention on iovad->iova_rbtree_lock a little bit. Cc: Joerg

[Patch v2 2/3] iommu: optimize iova_magazine_free_pfns()

2019-11-28 Thread Cong Wang
If the maganize is empty, iova_magazine_free_pfns() should be a nop, however it misses the case of mag->size==0. So we should just call iova_magazine_empty(). This should reduce the contention on iovad->iova_rbtree_lock a little bit. Cc: Joerg Roedel Signed-off-by: Cong Wang --- drivers/iommu/