linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: ulf.hansson@linaro.org, hch@lst.de, m.szyprowski@samsung.com,
	robin.murphy@arm.com, joro@8bytes.org, axboe@kernel.dk,
	wsa+renesas@sang-engineering.com, linux-mmc@vger.kernel.org,
	iommu@lists.linux-foundation.org, linux-block@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [RFC PATCH v7 5/5] mmc: queue: Use bigger segments if DMA MAP layer can merge the segments
Date: Mon, 24 Jun 2019 08:24:14 +0200	[thread overview]
Message-ID: <20190624062414.GD2989@lst.de> (raw)
In-Reply-To: <1561020610-953-6-git-send-email-yoshihiro.shimoda.uh@renesas.com>

On Thu, Jun 20, 2019 at 05:50:10PM +0900, Yoshihiro Shimoda wrote:
> When the max_segs of a mmc host is smaller than 512, the mmc
> subsystem tries to use 512 segments if DMA MAP layer can merge
> the segments, and then the mmc subsystem exposes such information
> to the block layer by using blk_queue_can_use_dma_map_merging().
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>  drivers/mmc/core/queue.c | 35 ++++++++++++++++++++++++++++++++---
>  include/linux/mmc/host.h |  1 +
>  2 files changed, 33 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
> index 92900a0..ab0ecc6 100644
> --- a/drivers/mmc/core/queue.c
> +++ b/drivers/mmc/core/queue.c
> @@ -24,6 +24,8 @@
>  #include "card.h"
>  #include "host.h"
>  
> +#define MMC_DMA_MAP_MERGE_SEGMENTS	512
> +
>  static inline bool mmc_cqe_dcmd_busy(struct mmc_queue *mq)
>  {
>  	/* Allow only 1 DCMD at a time */
> @@ -196,6 +198,12 @@ static void mmc_queue_setup_discard(struct request_queue *q,
>  		blk_queue_flag_set(QUEUE_FLAG_SECERASE, q);
>  }
>  
> +static unsigned int mmc_get_max_segments(struct mmc_host *host)
> +{
> +	return host->can_dma_map_merge ? MMC_DMA_MAP_MERGE_SEGMENTS :
> +					 host->max_segs;

I personally don't like superflous use of ? : if an if would be more
obvious:

	if (host->can_dma_map_merge)
		return MMC_DMA_MAP_MERGE_SEGMENTS;
	return host->max_segs;

but that is really just a nitpick and for the mmc maintainer to decide.

Otherwise looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2019-06-24  6:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20  8:50 [RFC PATCH v7 0/5] treewide: improve R-Car SDHI performance Yoshihiro Shimoda
2019-06-20  8:50 ` [RFC PATCH v7 1/5] dma: Introduce dma_get_merge_boundary() Yoshihiro Shimoda
2019-06-24  6:20   ` Christoph Hellwig
2019-06-20  8:50 ` [RFC PATCH v7 2/5] iommu/dma: Add a new dma_map_ops of get_merge_boundary() Yoshihiro Shimoda
2019-06-21  7:59   ` Marek Szyprowski
2019-06-24  6:21     ` Christoph Hellwig
2019-06-20  8:50 ` [RFC PATCH v7 3/5] block: sort headers on blk-setting.c Yoshihiro Shimoda
2019-06-20  8:50 ` [RFC PATCH v7 4/5] block: add a helper function to merge the segments Yoshihiro Shimoda
2019-06-24  6:22   ` Christoph Hellwig
2019-06-20  8:50 ` [RFC PATCH v7 5/5] mmc: queue: Use bigger segments if DMA MAP layer can " Yoshihiro Shimoda
2019-06-24  6:24   ` Christoph Hellwig [this message]
2019-07-08 11:45     ` Ulf Hansson
2019-07-01  8:32 ` [RFC PATCH v7 0/5] treewide: improve R-Car SDHI performance Christoph Hellwig
2019-07-08 11:45   ` Ulf Hansson
2019-07-08 16:22     ` Christoph Hellwig

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=20190624062414.GD2989@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa+renesas@sang-engineering.com \
    --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).