linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: Dave Chinner <david@fromorbit.com>, Liu Bo <bo.li.liu@oracle.com>
Cc: <linux-btrfs@vger.kernel.org>, Jan Kara <jack@suse.cz>,
	David Sterba <dsterba@suse.cz>
Subject: Re: [PATCH 4/6] Btrfs: add DAX support for nocow btrfs
Date: Fri, 9 Dec 2016 09:23:18 -0500	[thread overview]
Message-ID: <9b47dc14-5ab2-b5d4-f697-32b8a25614aa@fb.com> (raw)
In-Reply-To: <20161209051359.GO4219@dastard>



On 12/09/2016 12:13 AM, Dave Chinner wrote:
> On Wed, Dec 07, 2016 at 01:45:08PM -0800, Liu Bo wrote:
>> Since I haven't figure out how to map multiple devices to userspace without
>> pagecache, this DAX support is only for single-device, and I don't think
>> DAX(Direct Access) can work with cow, this is limited to nocow case.  I made
>> this by setting nodatacow in dax mount option.
>
> DAX can be made to work with COW quite easily - it's already been
> done, in fact. Go look up Nova for how it works with DAX:
>
> https://github.com/Andiry/nova
>
> Essentially, it has a set of "temporary pages" it links to the inode
> where writes are done directly, and when a synchronisation event
> occurs it pulls them from the per-inode list, does whatever
> transformations are needed (e.g. CRC calculation, mirroring, etc)
> and marks them them as current in the inode extent list.
>
> When a new overwrite comes along, it allocates a new block in the
> temporary page list, copies the existing data into it, and then uses
> that block for DAX until the next synchronisation event occurs.
>
> For XFS, CoW for DAX through read/write isn't really any different
> to the direct IO path we currently already have. And for page write
> faults on shared extents, instead of zeroing the newly allocated
> block we simply copy the original data into the new block before the
> allocation returns. It does mean, however, that XFS does not have
> the capability for data transformations in the IO path. This limits
> us to atomic write devices (software raid 0 or hardware redundancy
> such as DIMM mirroring), but we can still do out-of-band online data
> transformations and movement (e.g. dedupe, defrag) with DAX.
>
> Yes, I know these methods are very different to how btrfs uses COW.
> However, my point is that DAX and CoW and/or mulitple devices are
> not incompatible if the architecture is correctly structured. i.e
> DAX should be able to work even with most of btrfs's special magic
> still enabled.

Thanks for the pointer Dave, I'll check that out.  I'd much rather wait 
on DAX for btrfs until we have something that keeps all the features.

-chris

  reply	other threads:[~2016-12-09 14:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 21:45 [PATCH 0/6] btrfs dax IO Liu Bo
2016-12-07 21:45 ` [PATCH 1/6] Btrfs: add mount option for dax Liu Bo
2016-12-08  2:44   ` kbuild test robot
2016-12-09  4:47   ` Dave Chinner
2016-12-09 18:41     ` Liu Bo
2016-12-09 21:58       ` Dave Chinner
2016-12-07 21:45 ` [PATCH 2/6] Btrfs: set single device limit for dax usecase Liu Bo
2016-12-08 13:35   ` David Sterba
2016-12-08 15:19     ` Liu Bo
2016-12-07 21:45 ` [PATCH 3/6] Btrfs: refactor btrfs_file_write_iter Liu Bo
2016-12-08  0:44   ` kbuild test robot
2016-12-07 21:45 ` [PATCH 4/6] Btrfs: add DAX support for nocow btrfs Liu Bo
2016-12-07 22:15   ` Chris Mason
2016-12-07 22:51     ` Liu Bo
2016-12-08 10:47     ` Jan Kara
2016-12-08 16:45       ` Liu Bo
2016-12-09 12:31         ` Jan Kara
2016-12-09 18:38           ` Liu Bo
2016-12-08  1:16   ` kbuild test robot
2016-12-08  2:19     ` Janos Toth F.
2016-12-08  2:30   ` kbuild test robot
2016-12-09  5:13   ` Dave Chinner
2016-12-09 14:23     ` Chris Mason [this message]
2016-12-07 21:45 ` [PATCH 5/6] Btrfs: add mmap_sem to avoid race between page faults and truncate/hole_punch Liu Bo
2016-12-07 21:45 ` [PATCH 6/6] Btrfs: add tracepoint for btrfs_get_blocks_dax_fault Liu Bo

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=9b47dc14-5ab2-b5d4-f697-32b8a25614aa@fb.com \
    --to=clm@fb.com \
    --cc=bo.li.liu@oracle.com \
    --cc=david@fromorbit.com \
    --cc=dsterba@suse.cz \
    --cc=jack@suse.cz \
    --cc=linux-btrfs@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).