[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220511060212.GA32192@lst.de>
Date: Wed, 11 May 2022 08:02:12 +0200
From: "hch@....de" <hch@....de>
To: "Michael Kelley (LINUX)" <mikelley@...rosoft.com>
Cc: Robin Murphy <robin.murphy@....com>,
Tianyu Lan <ltykernel@...il.com>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
Dexuan Cui <decui@...rosoft.com>,
"jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"hch@...radead.org" <hch@...radead.org>,
"m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
Tianyu Lan <Tianyu.Lan@...rosoft.com>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
vkuznets <vkuznets@...hat.com>,
"konrad.wilk@...cle.com" <konrad.wilk@...cle.com>,
"hch@....de" <hch@....de>,
"parri.andrea@...il.com" <parri.andrea@...il.com>,
"thomas.lendacky@....com" <thomas.lendacky@....com>
Subject: Re: [PATCH] swiotlb: Max mapping size takes min align mask into
account
On Tue, May 10, 2022 at 06:26:55PM +0000, Michael Kelley (LINUX) wrote:
> > Hmm, this seems a bit pessimistic - the offset can vary per mapping, so
> > it feels to me like it should really be the caller's responsibility to
> > account for it if they're already involved enough to care about both
> > constraints. But I'm not sure how practical that would be.
>
> Tianyu and I discussed this prior to his submitting the patch.
> Presumably dma_max_mapping_size() exists so that the higher
> level blk-mq code can limit the size of I/O requests to something
> that will "fit" in the swiotlb when bounce buffering is enabled.
Yes, the idea that upper level code doesn't need to care was very
much the idea behind dma_max_mapping_size().
> As you mentioned, how else would a caller handle this situation?
Well, we could look at dma_get_min_align_mask in the caller and do
the calculation there, but I really don't think that is a good idea.
So this patch looks sensible to me.
Powered by blists - more mailing lists