Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: martin.petersen@oracle.com (Martin K. Petersen)
Subject: [PATCH] nvme: set discard_alignment to zero
Date: Thu, 30 Nov 2017 12:40:25 -0500	[thread overview]
Message-ID: <yq1bmjjekc6.fsf@oracle.com> (raw)
In-Reply-To: <20171124153053.23056-1-ddiss@suse.de> (David Disseldorp's message of "Fri, 24 Nov 2017 16:30:53 +0100")


David,

> Correcting the discard_alignment parameter to zero has no effect on how
> discard requests are propagated through the block layer - @alignment in
> __blkdev_issue_discard() remains zero. However, it does fix other
> consumers, such as LIO's Block Limits VPD response.
>
> Signed-off-by: David Disseldorp <ddiss at suse.de>
> ---
>  drivers/nvme/host/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 25da74d310d1..2e224ab5c340 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1287,7 +1287,7 @@ static void nvme_config_discard(struct nvme_ctrl *ctrl,
>  	BUILD_BUG_ON(PAGE_SIZE / sizeof(struct nvme_dsm_range) <
>  			NVME_DSM_MAX_RANGES);
>  
> -	queue->limits.discard_alignment = size;
> +	queue->limits.discard_alignment = 0;
>  	queue->limits.discard_granularity = size;

This looks good to me.

The alignment parameter was really only there to handle early drives
which were deliberately misaligned internally to avoid performance
penalties on operating systems that started the first partition on LBA
63.

Reviewed-by: Martin K. Petersen <martin.petersen at oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

  parent reply	other threads:[~2017-11-30 17:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24 15:30 [PATCH] nvme: set discard_alignment to zero David Disseldorp
2017-11-28 12:38 ` Christoph Hellwig
2017-12-01 22:15   ` Jens Axboe
2017-11-30 17:40 ` Martin K. Petersen [this message]
2017-12-04 20:20 ` 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=yq1bmjjekc6.fsf@oracle.com \
    --to=martin.petersen@oracle.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