All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org
Cc: adilger@dilger.ca, hch@infradead.org, martin.petersen@oracle.com
Subject: [PATCHSET v4] Add support for write life time hints
Date: Wed, 14 Jun 2017 21:45:01 -0600	[thread overview]
Message-ID: <1497498312-17704-1-git-send-email-axboe@kernel.dk> (raw)

A new iteration of this patchset, previously known as write streams.
As before, this patchset aims at enabling applications split up
writes into separate streams, based on the perceived life time
of the data written. This is useful for a variety of reasons:

- With NVMe 1.3 compliant devices, the device can expose multiple
  streams. Separating data written into streams based on life time
  can drastically reduce the write amplification. This helps device
  endurance, and increases performance. Testing just performed
  internally at Facebook with these patches showed up to a 25%
  reduction in NAND writes in a RocksDB setup.

- Software caching solutions can make more intelligent decisions
  on how and where to place data.

Contrary to previous patches, we're not exposing numeric stream values anymore.
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.

A branch based on current master can be pulled
from here:

git://git.kernel.dk/linux-block write-stream.4

Changes since v3:

- Change any naming of stream ID to write hint.
- Various little API changes, suggested by Christoph
- Cleanup the NVMe bits, dump the debug info.
- Change NVMe to lazily allocate the streams.
- Various NVMe error handling improvements and command checking.

Changes since v2:

- Get rid of bio->bi_stream and replace with four request/bio flags.
  These map directly to the RWF_WRITE_* flags that the user passes in.
- Cleanup the NVMe stream setting.
- Drivers now responsible for updating the queue stream write counter,
  as they determine what stream to map a given flag to.

Changes since v1:

- Guard queue stream stats to ensure we don't mess up memory, if
  bio_stream() ever were to return a larger value than we support.
- NVMe: ensure we set the stream modulo the name space defined count.
- Cleanup the RWF_ and IOCB_ flags. Set aside 4 bits, and just store
  the stream value in there. This makes the passing of stream ID from
  RWF_ space to IOCB_ (and IOCB_ to bio) more efficient, and cleans it
  up in general.
- Kill the block internal definitions of the stream type, we don't need
  them anymore. See above.

-- 
Jens Axboe

             reply	other threads:[~2017-06-15  3:45 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15  3:45 Jens Axboe [this message]
2017-06-15  3:45 ` [PATCH 01/11] block: add support for carrying stream information in a bio Jens Axboe
2017-06-15  3:45 ` [PATCH 02/11] blk-mq: expose stream write stats through debugfs Jens Axboe
2017-06-15  8:16   ` Christoph Hellwig
2017-06-15 14:24     ` Jens Axboe
2017-06-15  3:45 ` [PATCH 03/11] fs: add support for an inode to carry stream related data Jens Axboe
2017-06-15  8:17   ` Christoph Hellwig
2017-06-15 14:22     ` Jens Axboe
2017-06-15  3:45 ` [PATCH 04/11] fs: add support for allowing applications to pass in write life time hints 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-15  3:45 ` [PATCH 05/11] block: add helpers for setting/checking write hint validity Jens Axboe
2017-06-15  3:45 ` [PATCH 06/11] fs: add O_DIRECT support for sending down bio stream information Jens Axboe
2017-06-15  3:45 ` [PATCH 07/11] fs: add support for buffered writeback to pass down write hints Jens Axboe
2017-06-15  3:45 ` [PATCH 08/11] ext4: add support for passing in write hints for buffered writes Jens Axboe
2017-06-15  3:45 ` [PATCH 09/11] xfs: " Jens Axboe
2017-06-15  3:45 ` [PATCH 10/11] btrfs: " Jens Axboe
2017-06-15  3:45 ` [PATCH 11/11] nvme: add support for streams and directives Jens Axboe
2017-06-15  8:12 ` [PATCHSET v4] Add support for write life time hints Christoph Hellwig
2017-06-15 14:23   ` 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=1497498312-17704-1-git-send-email-axboe@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.