From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
"axboe\@kernel.dk" <axboe@kernel.dk>,
"linux-block\@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-ext4\@vger.kernel.org" <linux-ext4@vger.kernel.org>,
"tytso\@mit.edu" <tytso@mit.edu>,
"adilger.kernel\@dilger.ca" <adilger.kernel@dilger.ca>,
"ming.lei\@redhat.com" <ming.lei@redhat.com>,
"osandov\@fb.com" <osandov@fb.com>,
"jthumshirn\@suse.de" <jthumshirn@suse.de>,
"minwoo.im.dev\@gmail.com" <minwoo.im.dev@gmail.com>,
"damien.lemoal\@wdc.com" <damien.lemoal@wdc.com>,
"andrea.parri\@amarulasolutions.com"
<andrea.parri@amarulasolutions.com>,
"hare\@suse.com" <hare@suse.com>,
"tj\@kernel.org" <tj@kernel.org>,
"ajay.joshi\@wdc.com" <ajay.joshi@wdc.com>,
"sagi\@grimberg.me" <sagi@grimberg.me>,
"dsterba\@suse.com" <dsterba@suse.com>,
"chaitanya.kulkarni\@wdc.com" <chaitanya.kulkarni@wdc.com>,
"bvanassche\@acm.org" <bvanassche@acm.org>,
"dhowells\@redhat.com" <dhowells@redhat.com>,
"asml.silence\@gmail.com" <asml.silence@gmail.com>
Subject: Re: [PATCH RFC 1/3] block: Add support for REQ_OP_ASSIGN_RANGE operation
Date: Tue, 07 Jan 2020 21:49:06 -0500 [thread overview]
Message-ID: <yq1k1621x3x.fsf@oracle.com> (raw)
In-Reply-To: <d2835bd2-9579-74b5-4339-b576df79a9d5@virtuozzo.com> (Kirill Tkhai's message of "Tue, 7 Jan 2020 13:59:10 +0000")
Kirill,
>> Correct. We shouldn't go down this path unless a device is thinly
>> provisioned (i.e. max_discard_sectors > 0).
>
> (I assumed it is a typo, and you mean max_allocate_sectors like bellow).
No, this was in the context of not having an explicit queue limit for
allocation. If a device does not have max_discard_sectors > 0 then it is
not thinly provisioned and therefore attempting allocation makes no
sense.
>> I don't like "write_zeroes_can_allocate" because that makes assumptions
>> about WRITE ZEROES being the command of choice. I suggest we call it
>> "max_allocate_sectors" to mirror "max_discard_sectors". I.e. put
>> emphasis on the semantic operation and not the plumbing.
>
> Hm. Do you mean "bool max_allocate_sectors" or "unsigned int max_allocate_sectors"?
unsigned int. At least for SCSI we could have a device which would use
UNMAP for discards and WRITE SAME for allocates. And therefore the range
limit could be different for the two operations. Sadly.
I have a patch in the pipeline which deals with some problems in this
department because some devices have a split brain wrt. their discard
limits.
> In the second case we should make all the
> q->limits.max_write_zeroes_sectors dereferencing as switches like the
> below (this is a partial patch and only several of places are
> converted to switches as examples):
Something like that, yes.
This is getting a bit messy :( However, I am not sure that scattering
REQ_OP_ALLOCATE all over the I/O stack is particularly attractive
either.
Both REQ_OP_DISCARD and REQ_OP_WRITE_SAME come with some storage
protocol baggage that forces us to have special handling all over the
stack. But REQ_OP_WRITE_ZEROES is fairly clean and simple and, except
for the potentially different block count limit, an allocate operation
would be a carbon copy of the plumbing for write zeroes. A lot of
duplication.
So even through I'm increasingly torn on whether introducing separate
REQ_OP_ALLOCATE plumbing throughout the stack or having a REQ_ALLOCATE
flag for REQ_OP_WRITE_ZEROES is best, I still think I'm leaning towards
the latter. That will also make it easier for me in the SCSI disk
driver.
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2020-01-08 2:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 16:56 [PATCH RFC 0/3] block,ext4: Introduce REQ_OP_ASSIGN_RANGE to reflect extents allocation in block device internals Kirill Tkhai
2019-12-10 16:56 ` [PATCH RFC 1/3] block: Add support for REQ_OP_ASSIGN_RANGE operation Kirill Tkhai
2019-12-19 3:03 ` Martin K. Petersen
2019-12-19 11:07 ` Kirill Tkhai
2019-12-19 22:03 ` Chaitanya Kulkarni
2019-12-19 22:37 ` Martin K. Petersen
2019-12-20 1:53 ` Darrick J. Wong
2019-12-20 2:22 ` Martin K. Petersen
2019-12-20 11:55 ` Kirill Tkhai
2019-12-21 18:54 ` Martin K. Petersen
2019-12-23 8:51 ` Kirill Tkhai
2020-01-07 3:24 ` Martin K. Petersen
2020-01-07 13:59 ` Kirill Tkhai
2020-01-08 2:49 ` Martin K. Petersen [this message]
2020-01-09 9:43 ` Kirill Tkhai
2019-12-10 16:56 ` [PATCH RFC 2/3] loop: Forward REQ_OP_ASSIGN_RANGE into fallocate(0) Kirill Tkhai
2019-12-10 16:56 ` [PATCH RFC 3/3] ext4: Notify block device about fallocate(0)-assigned blocks Kirill Tkhai
2019-12-11 12:55 ` [PATCH RFC v2 " Kirill Tkhai
2019-12-11 7:42 ` [PATCH RFC 0/3] block,ext4: Introduce REQ_OP_ASSIGN_RANGE to reflect extents allocation in block device internals Chaitanya Kulkarni
2019-12-11 8:50 ` Kirill Tkhai
2019-12-17 14:16 ` Kirill Tkhai
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=yq1k1621x3x.fsf@oracle.com \
--to=martin.petersen@oracle.com \
--cc=adilger.kernel@dilger.ca \
--cc=ajay.joshi@wdc.com \
--cc=andrea.parri@amarulasolutions.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=chaitanya.kulkarni@wdc.com \
--cc=damien.lemoal@wdc.com \
--cc=dhowells@redhat.com \
--cc=dsterba@suse.com \
--cc=hare@suse.com \
--cc=jthumshirn@suse.de \
--cc=ktkhai@virtuozzo.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=minwoo.im.dev@gmail.com \
--cc=osandov@fb.com \
--cc=sagi@grimberg.me \
--cc=tj@kernel.org \
--cc=tytso@mit.edu \
/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).