From: Mike Snitzer <snitzer@redhat.com>
To: Douglas Gilbert <dgilbert@interlog.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
linux-scsi@vger.kernel.org, James.Bottomley@suse.de, hch@lst.de,
axboe@kernel.dk
Subject: Re: scsi: convert discard to REQ_TYPE_FS instead of REQ_TYPE_BLOCK_PC
Date: Thu, 8 Jul 2010 15:11:46 -0400 [thread overview]
Message-ID: <20100708191146.GA1538@redhat.com> (raw)
In-Reply-To: <4C33F619.4010302@interlog.com>
On Tue, Jul 06 2010 at 11:35pm -0400,
Douglas Gilbert <dgilbert@interlog.com> wrote:
> On 10-07-06 09:39 PM, Martin K. Petersen wrote:
> >>>>>>"Mike" == Mike Snitzer<snitzer@redhat.com> writes:
> >Mike> # cat /sys/block/sda/queue/discard_granularity
> >Mike> 512
> >Mike> # cat /sys/block/sda/queue/discard_max_bytes
> >Mike> 4294966784
> >
> >Mike> I'll look to understand why 'discard_max_bytes' is so large for
> >Mike> this LUN despite the standard Block limits VPD page not reflecting
> >Mike> this.
> >
> >discard_max_bytes is 0xFFFFFFFF for WRITE SAME(16).
>
> FORMAT UNIT has several associated mechanisms (e.g
> IMMED bit and REQUEST SENSE polling) that let it
> run for a long time. WRITE SAME has no such mechanisms.
> There was a proposal put to t10 to place an upper limit
> on WRITE SAME's lba count but I think that has been
> dropped. IMO if we want to give large block counts to
> UNMAP or WRITE SAME in the absence of guidance from the
> block limits VPD page, then we need to cope with
> device saying "nope".
>
> Whatever device Mike has it seems to be failing the
> WRITE SAME(16) command due to the huge lba block count.
> Does the device work with a smaller lba block count?
> For example:
> sg_write_same --unmap --lba 0 --num 1024 /dev/sda
Yes, and even large requests that have 4K granularity work.
Turns out that this LUN has a 4K granularity requirement (will fail the
WRITE SAME if the granularity requirements are not met).
4294966784 % 4096 = 3584
So we need to see why Linux actually has discard_max_bytes = 4294966784
rather than the full 0xFFFFFFFF we initialize in read_capacity_16:
q->limits.max_discard_sectors = 0xffffffff;
By bet is on blkdev_issue_discard:
unsigned int max_discard_sectors =
min(q->limits.max_discard_sectors, UINT_MAX >> 9);
Mike
next prev parent reply other threads:[~2010-07-08 19:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-06 7:01 [PATCH] scsi: convert discard to REQ_TYPE_FS instead of REQ_TYPE_BLOCK_PC FUJITA Tomonori
2010-07-06 21:31 ` Mike Snitzer
2010-07-06 23:40 ` Douglas Gilbert
2010-07-07 0:47 ` Mike Snitzer
2010-07-07 1:39 ` Martin K. Petersen
2010-07-07 2:19 ` Mike Snitzer
2010-07-07 3:35 ` Douglas Gilbert
2010-07-08 19:11 ` Mike Snitzer [this message]
2010-07-09 16:27 ` Martin K. Petersen
2010-07-09 18:06 ` Mike Snitzer
2010-07-09 16:22 ` Martin K. Petersen
2010-07-07 4:06 ` FUJITA Tomonori
2010-07-07 4:07 ` James Bottomley
2010-07-07 16:39 ` [PATCH] " Christoph Hellwig
2010-07-08 0:40 ` FUJITA Tomonori
2010-07-08 14:35 ` James Bottomley
2010-07-09 3:55 ` Christoph Hellwig
2010-07-09 4:42 ` FUJITA Tomonori
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=20100708191146.GA1538@redhat.com \
--to=snitzer@redhat.com \
--cc=James.Bottomley@suse.de \
--cc=axboe@kernel.dk \
--cc=dgilbert@interlog.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=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 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.