Re: [PATCH] iommu: Improve the performance for direct_mapping

2020-11-26 Thread Yong Wu
On Thu, 2020-11-26 at 15:19 +, Robin Murphy wrote: > On 2020-11-20 09:06, Yong Wu wrote: > > Currently direct_mapping always use the smallest pgsize which is SZ_4K > > normally to mapping. This is unnecessary. we could gather the size, and > > call iommu_map then, iommu_map could decide how to

Re: [PATCH] iommu: Improve the performance for direct_mapping

2020-11-26 Thread Robin Murphy
On 2020-11-20 09:06, Yong Wu wrote: Currently direct_mapping always use the smallest pgsize which is SZ_4K normally to mapping. This is unnecessary. we could gather the size, and call iommu_map then, iommu_map could decide how to map better with the just right pgsize. From the original

Re: [PATCH] iommu: Improve the performance for direct_mapping

2020-11-25 Thread Will Deacon
On Wed, Nov 25, 2020 at 07:03:34PM +0800, Yong Wu wrote: > On Tue, 2020-11-24 at 11:05 +, Will Deacon wrote: > > On Tue, Nov 24, 2020 at 05:24:44PM +0800, Yong Wu wrote: > > > On Mon, 2020-11-23 at 12:32 +, Will Deacon wrote: > > That said, maybe we could simplify this further by changing

Re: [PATCH] iommu: Improve the performance for direct_mapping

2020-11-25 Thread Yong Wu
On Tue, 2020-11-24 at 11:05 +, Will Deacon wrote: > On Tue, Nov 24, 2020 at 05:24:44PM +0800, Yong Wu wrote: > > On Mon, 2020-11-23 at 12:32 +, Will Deacon wrote: > > > On Fri, Nov 20, 2020 at 05:06:28PM +0800, Yong Wu wrote: > > > > + unmapped_sz = 0; > > > >

Re: [PATCH] iommu: Improve the performance for direct_mapping

2020-11-24 Thread Will Deacon
On Tue, Nov 24, 2020 at 05:24:44PM +0800, Yong Wu wrote: > On Mon, 2020-11-23 at 12:32 +, Will Deacon wrote: > > On Fri, Nov 20, 2020 at 05:06:28PM +0800, Yong Wu wrote: > > > + unmapped_sz = 0; > > > + } > > > + start += pg_size; > > > +

Re: [PATCH] iommu: Improve the performance for direct_mapping

2020-11-24 Thread Yong Wu
On Mon, 2020-11-23 at 12:32 +, Will Deacon wrote: > On Fri, Nov 20, 2020 at 05:06:28PM +0800, Yong Wu wrote: > > Currently direct_mapping always use the smallest pgsize which is SZ_4K > > normally to mapping. This is unnecessary. we could gather the size, and > > call iommu_map then, iommu_map

Re: [PATCH] iommu: Improve the performance for direct_mapping

2020-11-23 Thread Will Deacon
On Fri, Nov 20, 2020 at 05:06:28PM +0800, Yong Wu wrote: > Currently direct_mapping always use the smallest pgsize which is SZ_4K > normally to mapping. This is unnecessary. we could gather the size, and > call iommu_map then, iommu_map could decide how to map better with the > just right pgsize.

[PATCH] iommu: Improve the performance for direct_mapping

2020-11-20 Thread Yong Wu
Currently direct_mapping always use the smallest pgsize which is SZ_4K normally to mapping. This is unnecessary. we could gather the size, and call iommu_map then, iommu_map could decide how to map better with the just right pgsize. >From the original comment, we should take care overlap,