linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Jens Axboe <axboe@kernel.dk>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Simon Horman <horms+renesas@verge.net.au>,
	Jon Hunter <jonathanh@nvidia.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH 1/3] block: Respect the device's maximum segment size
Date: Wed, 11 Sep 2019 12:36:39 +0200	[thread overview]
Message-ID: <20190911103639.GA28124@lst.de> (raw)
In-Reply-To: <20190910073739.GB12537@ulmo>

On Tue, Sep 10, 2019 at 09:37:39AM +0200, Thierry Reding wrote:
> > > After that, all mmc controllers disable the feature as default, and if a mmc
> > > controller has such capable, the host driver should set the flag.
> > 
> > That sounds sensible to me.  Alternatively we'd have to limit
> > max_sectors to 16-bit values for sdhci if using an iommu that can
> > merge.
> 
> Isn't that effectively what dma_set_max_seg_size() is supposed to be
> doing? That tells the DMA API what the maximum size of a segment can
> be for the given device, right? If we make sure never to exceed that
> when compacting the SG, the SG that we get back should map just fine
> into the descriptors that SDHCI supports.

dma_set_max_seg_size() does indeed instruct the iommu drivers about
the merging capabilities (btw, swiotlb should be able to implement
this kind of merging as well, but that is a different discussion).

But the problem is that you don't just change the dma_set_max_seg_size,
but also the block layer max segment size setting, which is used for
block layer merges.  And we don't have the accounting for the first and
last segment in a request (those that are being merged to), so if you
enable the virt_boundary segments can grow to a size only limited by the
maximum request size.  We could add that accounting with a bit of
work, it's just that for devices that typicall use the virt boundary
there is no point (their actually segment is a page and not related
to the Linux "segment").

  reply	other threads:[~2019-09-11 10:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 12:56 [PATCH 0/3] mmc: Fix scatter/gather on SDHCI Thierry Reding
2019-09-09 12:56 ` [PATCH 1/3] block: Respect the device's maximum segment size Thierry Reding
2019-09-09 16:13   ` Christoph Hellwig
2019-09-09 19:19     ` Thierry Reding
2019-09-10  2:03       ` Yoshihiro Shimoda
2019-09-10  6:13         ` Christoph Hellwig
2019-09-10  7:37           ` Thierry Reding
2019-09-11 10:36             ` Christoph Hellwig [this message]
2019-09-10  7:30         ` Thierry Reding
2019-09-11  7:23           ` Yoshihiro Shimoda
2019-09-11 10:37         ` Christoph Hellwig
2019-09-12  0:57     ` Ming Lei
2019-09-12  8:19       ` Christoph Hellwig
2019-09-09 12:56 ` [PATCH 2/3] mmc: core: Respect MMC host's " Thierry Reding
2019-09-09 12:56 ` [PATCH 3/3] mmc: sdhci: Set DMA maximum segment size to 64 KiB Thierry Reding

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=20190911103639.GA28124@lst.de \
    --to=hch@lst.de \
    --cc=adrian.hunter@intel.com \
    --cc=axboe@kernel.dk \
    --cc=horms+renesas@verge.net.au \
    --cc=jonathanh@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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).