Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/6] btrfs dax IO
@ 2016-12-07 21:45 Liu Bo
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Bo @ 2016-12-07 21:45 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Chris Mason, Jan Kara, David Sterba

This is a prelimanary patch set to add dax support for btrfs, with
this we can do normal read/write to dax files and can mmap dax files
to userspace so that applications have the ability to access
persistent memory directly.

Please note that currently this is limited to nocow, i.e. all dax
inodes do not have COW behaviour.

COW:   	    	     	no
mutliple device:	no
clone/reflink:		no
snapshot:		no
compression:		no
checksum:		no

Right now snapshot is disabled while mounting with -odax, but snapshot
can be created without -odax, and writing to a dax file in snapshot
will get -EIO.

Clone/reflink is dealt with as same as snapshot, -EIO will be returned
when writing to shared extents.

This has adopted the latest iomap framework for dax read/write
and dax mmap.

With kernel command option "memmap=", I've had the whole patch set
tested with fstests, except those issues caused by failure of creating
snapshot/reflink and requirement for mutliple device, fstests said OK.

To test it, simply use kernel cmd option "memmap=", mkfs.btrfs and
mount -odax, then you're ready to go run anything upon dax-version
btrfs.

Liu Bo (6):
  Btrfs: add mount option for dax
  Btrfs: set single device limit for dax usecase
  Btrfs: refactor btrfs_file_write_iter
  Btrfs: add DAX support for nocow btrfs
  Btrfs: add mmap_sem to avoid race between page faults and
    truncate/hole_punch
  Btrfs: add tracepoint for btrfs_get_blocks_dax_fault

 fs/btrfs/Kconfig             |   1 +
 fs/btrfs/btrfs_inode.h       |   7 +
 fs/btrfs/ctree.h             |   6 +
 fs/btrfs/file.c              | 342 +++++++++++++++++++-----
 fs/btrfs/inode.c             | 599 +++++++++++++++++++++++++++++++++++++++++--
 fs/btrfs/ioctl.c             |  26 +-
 fs/btrfs/super.c             |  47 +++-
 include/trace/events/btrfs.h | 106 ++++++++
 8 files changed, 1048 insertions(+), 86 deletions(-)

-- 
2.5.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/6] btrfs dax IO
       [not found] <trinity-f6bd31da-24aa-4876-bde0-fe5b26b1af92-1481179495753@3capp-mailcom-bs01>
@ 2016-12-08  6:48 ` Xin Zhou
  2016-12-08 16:53   ` Liu Bo
  0 siblings, 1 reply; 3+ messages in thread
From: Xin Zhou @ 2016-12-08  6:48 UTC (permalink / raw)
  To: linux-btrfs

Hi Liu,
 
>From the patch, is the snapshot disabled by disabling the COW in the mounting path?
It seems the create_snapshot() in ioctl.c does not get changed.

I experienced some similar system but am a bit new to the brtfs code.
  
Thanks, 
Xin
 
 

Subject: [PATCH 0/6] btrfs dax IOFrom: Liu Bo <bo.li.liu@xxxxxxxxxx>Date: Wed, 7 Dec 2016 13:45:04 -0800Cc: Chris Mason <clm@xxxxxx>, Jan Kara <jack@xxxxxxx>, David Sterba <dsterba@xxxxxxx>
This is a prelimanary patch set to add dax support for btrfs, with
this we can do normal read/write to dax files and can mmap dax files
to userspace so that applications have the ability to access
persistent memory directly.

Please note that currently this is limited to nocow, i.e. all dax
inodes do not have COW behaviour.

COW:   	    	     	no
mutliple device:	no
clone/reflink:		no
snapshot:		no
compression:		no
checksum:		no

Right now snapshot is disabled while mounting with -odax, but snapshot
can be created without -odax, and writing to a dax file in snapshot
will get -EIO.

Clone/reflink is dealt with as same as snapshot, -EIO will be returned
when writing to shared extents.

This has adopted the latest iomap framework for dax read/write
and dax mmap.

 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/6] btrfs dax IO
  2016-12-08  6:48 ` [PATCH 0/6] btrfs dax IO Xin Zhou
@ 2016-12-08 16:53   ` Liu Bo
  0 siblings, 0 replies; 3+ messages in thread
From: Liu Bo @ 2016-12-08 16:53 UTC (permalink / raw)
  To: Xin Zhou; +Cc: linux-btrfs

On Thu, Dec 08, 2016 at 07:48:18AM +0100, Xin Zhou wrote:
> Hi Liu,
>  
> From the patch, is the snapshot disabled by disabling the COW in the mounting path?
> It seems the create_snapshot() in ioctl.c does not get changed.

Well, I think I made a mistake in this cover letter, snapshot still
works while mounting with dax, but if a snapshot is taken, then we'll
get -EIO while writing to dax inodes that belong to either snapshot tree
or its source tree.  So in fact, only a readonly snapshot makes sense in
practice, I'll update the patch so that we only allow a readonly
snapshot to be taken.

COW is disabled by letting the dax mount option imply the "nodatacow"
option.

Thanks for spotting this!

Thanks,

-liubo

> 
> I experienced some similar system but am a bit new to the brtfs code.
>   
> Thanks, 
> Xin
>  
>  
> 
> Subject: [PATCH 0/6] btrfs dax IOFrom: Liu Bo <bo.li.liu@xxxxxxxxxx>Date: Wed, 7 Dec 2016 13:45:04 -0800Cc: Chris Mason <clm@xxxxxx>, Jan Kara <jack@xxxxxxx>, David Sterba <dsterba@xxxxxxx>
> This is a prelimanary patch set to add dax support for btrfs, with
> this we can do normal read/write to dax files and can mmap dax files
> to userspace so that applications have the ability to access
> persistent memory directly.
> 
> Please note that currently this is limited to nocow, i.e. all dax
> inodes do not have COW behaviour.
> 
> COW:   	    	     	no
> mutliple device:	no
> clone/reflink:		no
> snapshot:		no
> compression:		no
> checksum:		no
> 
> Right now snapshot is disabled while mounting with -odax, but snapshot
> can be created without -odax, and writing to a dax file in snapshot
> will get -EIO.
> 
> Clone/reflink is dealt with as same as snapshot, -EIO will be returned
> when writing to shared extents.
> 
> This has adopted the latest iomap framework for dax read/write
> and dax mmap.
> 
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-08 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <trinity-f6bd31da-24aa-4876-bde0-fe5b26b1af92-1481179495753@3capp-mailcom-bs01>
2016-12-08  6:48 ` [PATCH 0/6] btrfs dax IO Xin Zhou
2016-12-08 16:53   ` Liu Bo
2016-12-07 21:45 Liu Bo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox