linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: John Garry <john.garry@huawei.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Christoph Hellwig <hch@lst.de>
Cc: joro@8bytes.org, will@kernel.org, jejb@linux.ibm.com,
	m.szyprowski@samsung.com, robin.murphy@arm.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-ide@vger.kernel.org, iommu@lists.linux-foundation.org,
	iommu@lists.linux.dev, linux-scsi@vger.kernel.org,
	linuxarm@huawei.com
Subject: Re: [PATCH v5 0/5] DMA mapping changes for SCSI core
Date: Mon, 11 Jul 2022 19:40:22 +0900	[thread overview]
Message-ID: <62b801e8-66b6-0af7-b0c9-195823bf9f62@opensource.wdc.com> (raw)
In-Reply-To: <a415e4a1-72ce-53e1-437a-fc7e56e4b913@huawei.com>

On 7/11/22 16:36, John Garry wrote:
> On 11/07/2022 00:08, Damien Le Moal wrote:
>>> Ah, I think that I misunderstood Damien's question. I thought he was
>>> asking why not keep shost max_sectors at dma_max_mapping_size() and then
>>> init each sdev request queue max hw sectors at dma_opt_mapping_size().
>> I was suggesting the reverse:)  Keep the device hard limit
>> (max_hw_sectors) to the max dma mapping and set the soft limit
>> (max_sectors) to the optimal dma mapping size.
> 
> Sure, but as I mentioned below, I only see a small % of requests whose 
> mapping size exceeds max_sectors but that still causes a big performance 
> hit. So that is why I want to set the hard limit as the optimal dma 
> mapping size.

How can you possibly end-up with requests larger than max_sectors ? BIO
split is done using this limit, right ? Or is it that request merging is
allowed up to max_hw_sectors even if the resulting request size exceeds
max_sectors ?

> 
> Indeed, the IOMMU IOVA caching limit is already the same as default 
> max_sectors for the disks in my system - 128Kb for 4k page size.
> 
>>
>>> But he seems that you want to know why not have the request queue max
>>> sectors at dma_opt_mapping_size(). The answer is related to meaning of
>>> dma_opt_mapping_size(). If we get any mappings which exceed this size
>>> then it can have a big dma mapping performance hit. So I set max hw
>>> sectors at this ‘opt’ mapping size to ensure that we get no mappings
>>> which exceed this size. Indeed, I think max sectors is 128Kb today for
>>> my host, which would be same as dma_opt_mapping_size() value with an
>>> IOMMU enabled. And I find that only a small % of request size may exceed
>>> this 128kb size, but it still has a big performance impact.
>>>
> 
> Thanks,
> John


-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2022-07-11 11:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 12:08 [PATCH v5 0/5] DMA mapping changes for SCSI core John Garry
2022-06-30 12:08 ` [PATCH v5 1/5] dma-mapping: Add dma_opt_mapping_size() John Garry
2022-06-30 12:08 ` [PATCH v5 2/5] dma-iommu: Add iommu_dma_opt_mapping_size() John Garry
2022-06-30 12:08 ` [PATCH v5 3/5] scsi: core: Cap shost max_sectors according to DMA limits only once John Garry
2022-06-30 23:41   ` Damien Le Moal
2022-07-01  8:02     ` John Garry
2022-06-30 12:08 ` [PATCH v5 4/5] scsi: scsi_transport_sas: Cap shost max_sectors according to DMA optimal limit John Garry
2022-06-30 23:49   ` Damien Le Moal
2022-07-01  8:46     ` John Garry
2022-06-30 12:08 ` [PATCH v5 5/5] ata: libata-scsi: Cap ata_device->max_sectors according to shost->max_sectors John Garry
2022-07-06 13:40 ` [PATCH v5 0/5] DMA mapping changes for SCSI core John Garry
2022-07-06 13:44   ` Christoph Hellwig
2022-07-07 20:35     ` Martin K. Petersen
2022-07-08 16:17       ` John Garry
2022-07-10 23:08         ` Damien Le Moal
2022-07-11  7:36           ` John Garry
2022-07-11 10:40             ` Damien Le Moal [this message]
2022-07-11 14:49               ` John Garry
2022-07-14  3:10         ` Martin K. Petersen
2022-07-14  7:52           ` John Garry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62b801e8-66b6-0af7-b0c9-195823bf9f62@opensource.wdc.com \
    --to=damien.lemoal@opensource.wdc.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=iommu@lists.linux.dev \
    --cc=jejb@linux.ibm.com \
    --cc=john.garry@huawei.com \
    --cc=joro@8bytes.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=m.szyprowski@samsung.com \
    --cc=martin.petersen@oracle.com \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).