From: Jens Axboe <axboe@kernel.dk>
To: Andreas Dilger <adilger@dilger.ca>
Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH 0/11] Add support for write life time hints
Date: Tue, 13 Jun 2017 14:13:34 -0600 [thread overview]
Message-ID: <ee7a8e90-5df9-c1fc-e07e-5d0e62d6334c@kernel.dk> (raw)
In-Reply-To: <2A5802CF-4DA7-477E-B5AA-F31FCD7F7908@dilger.ca>
On 06/13/2017 01:21 PM, Andreas Dilger wrote:
> On Jun 13, 2017, at 12:26 PM, Jens Axboe <axboe@kernel.dk> wrote:
>>
>> On 06/13/2017 12:04 PM, Andreas Dilger wrote:
>>> On Jun 13, 2017, at 11:15 AM, Jens Axboe <axboe@kernel.dk> wrote:
>>>>
>>>> A new iteration of this patchset, previously known as write streams.
>>>> Instead of exposing numeric values for streams, I've previously
>>>> advocated for just doing a set of hints that makes sense instead. See
>>>> the coverage from the LSFMM summit this year:
>>>>
>>>> https://lwn.net/Articles/717755/
>>>>
>>>> This patchset attempts to do that. We define 4 flags for the pwritev2
>>>> system call:
>>>>
>>>> RWF_WRITE_LIFE_SHORT Data written with this flag is expected to have
>>>> a high overwrite rate, or life time.
>>>>
>>>> RWF_WRITE_LIFE_MEDIUM Longer life time than SHORT
>>>>
>>>> RWF_WRITE_LIFE_LONG Longer life time than MEDIUM
>>>>
>>>> RWF_WRITE_LIFE_EXTREME Longer life time than LONG
>>>>
>>>> The idea is that these are relative values, so an application can
>>>> use them as they see fit. The underlying device can then place
>>>> data appropriately, or be free to ignore the hint. It's just a hint.
>>>>
>>>> Comments appreciated.
>>>
>>> I thought that one of the major attractions of numeric stream IDs was
>>> that they had no semantic meanings, just "N is similar to N" and "M is
>>> similar to M", and it is up to userspace to define what these mean?
>>>
>>> That allows userspace to use the IDs for lifetimes (as above), but
>>> also/instead use them for allocation sizes, different applications,
>>> different users, etc.
>>
>> Right, that is indeed the intent. But we have to attach some naming
>> to them. Userspace could in theory use these totally randomly, and
>> things like NVMe would not care. But the semantic meaning of "short"
>> vs "long" is important on caching infrastructure where you might
>> want to use the hint for data placement.
>>
>> I think the important part here is that no absolute meaning is
>> attached to them, only relative.
>
> In both IOCB_WRITE_LIFE_* and RWF_WRITE_LIFE_* this is consuming 4 bits of
> space (which is itself fine) for only 4 different stream IDs. Why not just
> shift a 4-bit arbitrary stream ID to the appropriate offset in those fields,
> rather than treating them as 4 individual bits and allowing only one of
> them to be passed down the stack at a time?
I did think about that, and I'm a bit split on it. It turns a bit mask
into a hybrid beast, with bits and sets of bits for values.
For utilization of the space, yes, we could just use 2 bits instead of
the 4. Or use the 4 bits and potentially have the app pass in up to 16
values. For the latter, I'm still very much in favor of keeping the app
interface super simple and just retaining the 4 life time types.
If folks feel strongly about the wasted space, and I can definitely
revisit and just pack it.
--
Jens Axboe
next prev parent reply other threads:[~2017-06-13 20:13 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-13 17:15 [PATCH 0/11] Add support for write life time hints Jens Axboe
2017-06-13 17:15 ` [PATCH 01/11] block: add support for carrying stream information in a bio Jens Axboe
2017-06-13 19:01 ` Andreas Dilger
2017-06-13 17:15 ` [PATCH 02/11] block: add definition for support data write life times Jens Axboe
2017-06-13 19:07 ` Andreas Dilger
2017-06-13 20:10 ` Jens Axboe
2017-06-13 17:15 ` [PATCH 03/11] blk-mq: expose stream write stats through debugfs Jens Axboe
2017-06-13 19:21 ` Andreas Dilger
2017-06-13 20:11 ` Jens Axboe
2017-06-13 17:15 ` [PATCH 04/11] fs: add support for an inode to carry stream related data Jens Axboe
2017-06-13 19:24 ` [PATCH 04/11] " Andreas Dilger
2017-06-13 20:14 ` Jens Axboe
2017-06-13 17:15 ` [PATCH 05/11] fs: add support for allowing applications to pass in write life time hints Jens Axboe
2017-06-13 19:36 ` [PATCH 05/11] " Andreas Dilger
2017-06-13 20:21 ` Jens Axboe
2017-06-13 17:15 ` [PATCH 06/11] fs: add O_DIRECT support for sending down bio stream information Jens Axboe
2017-06-13 19:38 ` Andreas Dilger
2017-06-13 17:15 ` [PATCH 07/11] fs: add support for buffered writeback to pass down " Jens Axboe
2017-06-13 19:39 ` [PATCH 07/11] " Andreas Dilger
2017-06-13 17:15 ` [PATCH 08/11] ext4: add support for passing in stream information for buffered writes Jens Axboe
2017-06-13 19:40 ` Andreas Dilger
2017-06-13 17:15 ` [PATCH 09/11] xfs: " Jens Axboe
2017-06-13 19:40 ` Andreas Dilger
2017-06-13 17:15 ` [PATCH 10/11] btrfs: " Jens Axboe
2017-06-13 19:41 ` Andreas Dilger
2017-06-13 17:15 ` [PATCH 11/11] nvme: add support for streams and directives Jens Axboe
2017-06-13 19:47 ` Andreas Dilger
2017-06-13 20:25 ` Jens Axboe
2017-06-13 21:12 ` Andreas Dilger
2017-06-13 21:18 ` Jens Axboe
2017-06-13 18:04 ` [PATCH 0/11] Add support for write life time hints Andreas Dilger
2017-06-13 18:26 ` Jens Axboe
2017-06-13 19:21 ` Andreas Dilger
2017-06-13 20:13 ` Jens Axboe [this message]
2017-06-13 20:45 ` Andreas Dilger
2017-06-13 20:56 ` Jens Axboe
2017-06-13 21:53 ` Andreas Dilger
2017-06-13 22:12 ` Jens Axboe
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=ee7a8e90-5df9-c1fc-e07e-5d0e62d6334c@kernel.dk \
--to=axboe@kernel.dk \
--cc=adilger@dilger.ca \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@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 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).