All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: target-devel@vger.kernel.org
Subject: Re: [RFC PATCH] target: enable discard if supported by underlying block device
Date: Wed, 03 Jan 2018 12:25:24 +0000	[thread overview]
Message-ID: <20180103132524.46098356@suse.de> (raw)
In-Reply-To: <20171219134517.17296-1-ddiss@suse.de>

Ping, any thoughts on this one? I think it makes sense to enable unmap
in this case.

Cheers, David

On Tue, 19 Dec 2017 14:45:17 +0100, David Disseldorp wrote:

> The initial commit of LIO (v4.0.0-rc6) came with support for SCSI UNMAP
> disabled. This was justified in the LIO wiki with:
>   Many SATA SSDs have issues handling UNMAP properly, so it is disabled
>   per default in LIO.
> Since this time, some critical discard bugs have been fixed, e.g.
> f3f5da624e0a ("block: Do a full clone when splitting discard bios").
> 
> Block layer backed logical units are capable of deferring to the block
> layer when determining UNMAP attributes, but this logic currently leaves
> the emulate_tpu (UNMAP) and emulate_tpws (WRITE_SAME with UNMAP=1) flags
> disabled.
> With this change, emulate_tpu and emulate_tpws are set for block layer
> backed logical units based on underlying block device discard support.
> 
> Signed-off-by: David Disseldorp <ddiss@suse.de>
> ---
>  drivers/target/target_core_device.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
> index e8dd6da164b2..65dab7c2460a 100644
> --- a/drivers/target/target_core_device.c
> +++ b/drivers/target/target_core_device.c
> @@ -856,6 +856,8 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
>  	attrib->unmap_granularity_alignment = q->limits.discard_alignment /
>  								block_size;
>  	attrib->unmap_zeroes_data = (q->limits.max_write_zeroes_sectors);
> +	attrib->emulate_tpu = 1;
> +	attrib->emulate_tpws = 1;
>  	return true;
>  }
>  EXPORT_SYMBOL(target_configure_unmap_from_queue);


  reply	other threads:[~2018-01-03 12:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 13:45 [RFC PATCH] target: enable discard if supported by underlying block device David Disseldorp
2018-01-03 12:25 ` David Disseldorp [this message]
2018-01-03 18:33 ` Mike Christie
2018-01-03 22:27 ` David Disseldorp
2018-01-13  5:13 ` Nicholas A. Bellinger

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=20180103132524.46098356@suse.de \
    --to=ddiss@suse.de \
    --cc=target-devel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.