All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
	adilger@dilger.ca, martin.petersen@oracle.com
Subject: Re: [PATCH 04/11] fs: add support for allowing applications to pass in write life time hints
Date: Mon, 19 Jun 2017 20:06:19 -0600	[thread overview]
Message-ID: <28118638-9466-4816-2438-1ecf7ba4b756@kernel.dk> (raw)
In-Reply-To: <3e6f7b97-8372-b268-f55a-cc88812c1a68@kernel.dk>

On 06/19/2017 02:33 PM, Jens Axboe wrote:
> On 06/19/2017 01:10 PM, Jens Axboe wrote:
>> On 06/19/2017 01:00 PM, Jens Axboe wrote:
>>> On 06/19/2017 12:58 PM, Christoph Hellwig wrote:
>>>> On Mon, Jun 19, 2017 at 10:02:09AM -0600, Jens Axboe wrote:
>>>>> Actually, one good use case is O_DIRECT on a block device. Since I'm
>>>>> not a huge fan of having per-call hints that is only useful for a
>>>>> single case, how about we add the hints to the struct file as well?
>>>>> For buffered IO, just grab it from the inode. If we have a file
>>>>> available, then that overrides the per-inode setting.
>>>>
>>>> Even for buffered I/O per-fіle would seem more useful to be honest.
>>>> For the buffer_head based file systems this could even be done fairly
>>>> easily.
>>>
>>> If I add the per-file hint as well, then anywhere that has the file should
>>> just grab it from there. Unless not set, then grab from inode.
>>>
>>> That does raise an issue with the NONE hint being 0. We can tell right now
>>> if NONE was set, or nothing was set. This becomes a problem if we want the
>>> file hint to override the inode hint. Should probably just bump the values
>>> up by one, so that NONE is 1, SHORT is 2, etc.
>>
>> Actually, we don't have to, as long as the file inherits the inode mask.
>> Then we can just use the file hint if it differs from the inode hint.
> 
> That doesn't work, in case it's cleared, or for checking whether it has
> been set or not. Oh well, I added a NOT_SET variant for this. See below
> for an incremental that adds support for file write hints as well. Use
> the file write hint, if we have it, otherwise use the inode provided
> one.
> 
> Setting hints on a file propagates to the inode, only if the inode doesn't
> currently have a hint set.

I didn't like the special 0x7 for NOT_SET since it hard codes the fact
that we currently use 3 bits, and since we have to initialize the inode
flags to that weird value. Since I sent out a v8 already, I'll just
point at the current branch;

http://git.kernel.dk/cgit/linux-block/log/?h=write-stream

The main change is using 0 as the NOT_SET value, and shifting everything
up by one. I think this is better, since we can also use that value to
clear hints down to the inode. Additionally, if we add more hints in
the future, it's much saner to retain '0' as the NOT_SET value, rather
than having a strange magic value for it.

Let me know what you think. As far as I'm concerned, the core API should
be ready now. For the NVMe bits, I'm fine with removing the stream
allocation.

-- 
Jens Axboe

  reply	other threads:[~2017-06-20  2:06 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-17 19:59 [PATCHSET v7] Add support for write life time hints Jens Axboe
2017-06-17 19:59 ` [PATCH 01/11] fs: add support for an inode to carry write hint related data Jens Axboe
2017-06-19  6:26   ` Christoph Hellwig
2017-06-19 14:55     ` Jens Axboe
2017-06-17 19:59 ` [PATCH 02/11] block: add support for write hints in a bio Jens Axboe
2017-06-17 19:59 ` [PATCH 03/11] blk-mq: expose stream write hints through debugfs Jens Axboe
2017-06-17 19:59 ` [PATCH 04/11] fs: add support for allowing applications to pass in write life time hints Jens Axboe
2017-06-19  6:27   ` Christoph Hellwig
2017-06-19 14:56     ` Jens Axboe
2017-06-19 16:02       ` Jens Axboe
2017-06-19 18:58         ` Christoph Hellwig
2017-06-19 19:00           ` Jens Axboe
2017-06-19 19:10             ` Jens Axboe
2017-06-19 20:33               ` Jens Axboe
2017-06-20  2:06                 ` Jens Axboe [this message]
2017-06-20  8:57                 ` Christoph Hellwig
2017-06-20 12:43                   ` Jens Axboe
2017-06-20 12:43                     ` Christoph Hellwig
2017-06-20 12:45                       ` Jens Axboe
2017-06-20 12:47                         ` Christoph Hellwig
2017-06-20 12:51                           ` Jens Axboe
2017-06-20 12:56                             ` Christoph Hellwig
2017-06-20 13:00                               ` Jens Axboe
2017-06-17 19:59 ` [PATCH 05/11] fs: add fcntl() interface for setting/getting " Jens Axboe
2017-06-19  6:28   ` Christoph Hellwig
2017-06-19 14:57     ` Jens Axboe
2017-06-17 19:59 ` [PATCH 06/11] fs: add O_DIRECT support for sending down " Jens Axboe
2017-06-19  6:28   ` Christoph Hellwig
2017-06-19 14:57     ` Jens Axboe
2017-06-17 19:59 ` [PATCH 07/11] fs: add support for buffered writeback to pass down write hints Jens Axboe
2017-06-17 19:59 ` [PATCH 08/11] ext4: add support for passing in write hints for buffered writes Jens Axboe
2017-06-17 19:59 ` [PATCH 09/11] xfs: " Jens Axboe
2017-06-17 19:59 ` [PATCH 10/11] btrfs: " Jens Axboe
2017-06-17 19:59 ` [PATCH 11/11] nvme: add support for streams and directives Jens Axboe
2017-06-19  6:35   ` Christoph Hellwig
2017-06-19 15:04     ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2017-06-16 17:24 [PATCHSET v6] Add support for write life time hints Jens Axboe
2017-06-16 17:24 ` [PATCH 04/11] fs: add support for allowing applications to pass in " Jens Axboe
2017-06-15  3:45 [PATCHSET v4] Add support for " Jens Axboe
2017-06-15  3:45 ` [PATCH 04/11] fs: add support for allowing applications to pass in " Jens Axboe
2017-06-15  4:15   ` Darrick J. Wong
2017-06-15  4:33     ` Jens Axboe
2017-06-15  8:19       ` Christoph Hellwig
2017-06-15 14:21         ` Jens Axboe
2017-06-15 15:23           ` Jens Axboe
2017-06-16  7:30             ` Christoph Hellwig
2017-06-16 14:35               ` Jens Axboe
2017-06-16  7:33           ` Christoph Hellwig
2017-06-16 14:35             ` Jens Axboe
2017-06-16 14:53               ` Jens Axboe
2017-06-16 15:52               ` Christoph Hellwig
2017-06-16 15:59                 ` Jens Axboe
2017-06-16 16:14                   ` Jens Axboe
2017-06-16 18:00                     ` Christoph Hellwig
2017-06-16 18:02                   ` Christoph Hellwig
2017-06-16 19:35                     ` Jens Axboe
2017-06-15 11:24     ` Al Viro
2017-06-14 19:05 [PATCHSET v3] Add support for " Jens Axboe
2017-06-14 19:05 ` [PATCH 04/11] fs: add support for allowing applications to pass in " Jens Axboe
2017-06-14 20:26   ` Christoph Hellwig
2017-06-14 20:37     ` 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=28118638-9466-4816-2438-1ecf7ba4b756@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=adilger@dilger.ca \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@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.