Linux Device Mapper development
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Lukas Czerner <lczerner@redhat.com>,
	sandeen@redhat.com, Christoph Hellwig <hch@infradead.org>,
	device-mapper development <dm-devel@redhat.com>,
	DarkNovaNick@gmail.com, linux-lvm@redhat.com,
	linux-ext4@vger.kernel.org, Alasdair G Kergon <agk@redhat.com>
Subject: Re: do not disable ext4 discards on first discard failure? [was: Re: dm snapshot: ignore discards issued to the snapshot-origin target]
Date: Wed, 4 May 2011 12:02:32 -0400	[thread overview]
Message-ID: <20110504160231.GD31241@redhat.com> (raw)
In-Reply-To: <yq1wri6zel9.fsf@sermon.lab.mkp.net>

On Wed, May 04 2011 at 11:10am -0400,
Martin K. Petersen <martin.petersen@oracle.com> wrote:

> >>>>> "Lukas" == Lukas Czerner <lczerner@redhat.com> writes:
> 
> Lukas> Nevertheless there is something weird going on, because even when
> Lukas> I create striped volume I get this:
> 
> Could you please try the following patch? It has a bunch of small tweaks
> to the discard stack in it. I'll split it up before posting for real but
> I'd like to know if it fixes your issue...
> 
> 
> block/libata/scsi: Various logical block provisioning fixes
> 
>  - Add sysfs documentation for the discard topology parameters
> 
>  - Fix discard stacking problem
> 
>  - Switch our libata SAT over to using the WRITE SAME limits
> 
>  - UNMAP alignment needs to be converted to bytes
> 
>  - Only report alignment and zeroes_data if the device supports discard
> 
> Reported-by: Lukas Czerner <lczerner@redhat.com>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> 
> diff --git a/block/blk-settings.c b/block/blk-settings.c
> index 1fa7692..42d3bf5 100644
> --- a/block/blk-settings.c
> +++ b/block/blk-settings.c
> @@ -120,7 +120,7 @@ void blk_set_default_limits(struct queue_limits *lim)
>  	lim->discard_granularity = 0;
>  	lim->discard_alignment = 0;
>  	lim->discard_misaligned = 0;
> -	lim->discard_zeroes_data = -1;
> +	lim->discard_zeroes_data = 1;
>  	lim->logical_block_size = lim->physical_block_size = lim->io_min = 512;
>  	lim->bounce_pfn = (unsigned long)(BLK_BOUNCE_ANY >> PAGE_SHIFT);
>  	lim->alignment_offset = 0;

lim->discard_zeroes_data = -1; was suspect to me too.
But why default to 1 here?

> @@ -166,6 +166,7 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn)
>  
>  	blk_set_default_limits(&q->limits);
>  	blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
> +	q->limits.discard_zeroes_data = 0;
>  
>  	/*
>  	 * by default assume old behaviour and bounce for any highmem page

Only to then reset to 0 here?  Shouldn't we default to 0 and only set to
1 where applicable (e.g. sd_config_discard)?

  reply	other threads:[~2011-05-04 16:02 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110412234706.GA11244@redhat.com>
     [not found] ` <20cf301cbef67d323104a0c2ff52@google.com>
2011-04-13 22:40   ` [PATCH] dm snapshot: add discard support to the snapshot-origin target [was: Re: Testing TRIM with LVM] Mike Snitzer
2011-04-13 23:48     ` Mike Snitzer
2011-04-26 17:32       ` Mike Snitzer
2011-04-28  0:19         ` [PATCH] dm snapshot: ignore discards issued to the snapshot-origin target Mike Snitzer
2011-04-28  7:53           ` Christoph Hellwig
2011-04-28 20:59             ` do not disable ext4 discards on first discard failure? [was: Re: dm snapshot: ignore discards issued to the snapshot-origin target] Mike Snitzer
2011-04-28 21:28               ` Eric Sandeen
2011-04-28 22:59                 ` [linux-lvm] " Alasdair G Kergon
2011-04-28 23:01                   ` Eric Sandeen
2011-04-28 23:11                     ` Alasdair G Kergon
2011-04-29  1:12               ` Andreas Dilger
2011-04-29 13:55                 ` Mike Snitzer
2011-04-29  9:30               ` Lukas Czerner
2011-04-29 12:24                 ` [dm-devel] " Alasdair G Kergon
2011-04-29 12:29                   ` Christoph Hellwig
2011-04-29 14:28                     ` Eric Sandeen
2011-04-29 15:13                       ` [linux-lvm] " Ray Morris
2011-05-04 16:33                       ` Ted Ts'o
2011-05-04 17:02                         ` Lukas Czerner
2011-05-02  7:16                   ` Lukas Czerner
2011-05-02  8:13                     ` Alasdair G Kergon
2011-05-02  8:19                       ` Christoph Hellwig
2011-05-02 10:24                         ` Lukas Czerner
2011-05-02 12:48                           ` Mike Snitzer
2011-05-02 13:05                             ` Lukas Czerner
2011-05-02 14:47                               ` Eric Sandeen
2011-05-02 14:48                                 ` Christoph Hellwig
2011-05-02 14:58                                 ` Lukas Czerner
2011-05-02 13:48                           ` [dm-devel] " Martin K. Petersen
2011-05-02 14:20                           ` Martin K. Petersen
2011-05-02 14:39                             ` [dm-devel] " Lukas Czerner
2011-05-02 14:50                               ` Martin K. Petersen
2011-05-02 14:58                               ` Mike Snitzer
2011-05-02 16:58                               ` [dm-devel] " Martin K. Petersen
2011-05-03  8:57                                 ` Lukas Czerner
2011-05-04 15:10                                   ` Martin K. Petersen
2011-05-04 16:02                                     ` Mike Snitzer [this message]
2011-05-04 16:50                                       ` Martin K. Petersen
2011-05-04 18:03                                         ` Mike Snitzer
2011-05-04 17:10                                     ` [dm-devel] " Lukas Czerner
2011-05-04 17:32                                       ` Martin K. Petersen
2011-05-04 17:35                                         ` Lukas Czerner
2011-05-18 12:16                                     ` Mike Snitzer
2011-05-18 12:52                                       ` Mike Snitzer
2011-05-04 15:16                                   ` [dm-devel] " Martin K. Petersen
2011-05-04 16:12                                     ` Lukas Czerner
2011-05-05  8:33                                     ` Karel Zak
2011-05-05 10:48                                       ` Lukas Czerner

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=20110504160231.GD31241@redhat.com \
    --to=snitzer@redhat.com \
    --cc=DarkNovaNick@gmail.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-lvm@redhat.com \
    --cc=martin.petersen@oracle.com \
    --cc=sandeen@redhat.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