xfs
[Top] [All Lists]

Re: [PATCH] xfs: don't invalidate whole file on DAX read/write

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: don't invalidate whole file on DAX read/write
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 3 Aug 2016 02:25:02 -0700
Cc: xfs@xxxxxxxxxxx, jack@xxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1470181226-20935-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1470181226-20935-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.6.1 (2016-04-27)
On Wed, Aug 03, 2016 at 09:40:26AM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> When we do DAX IO, we try to invalidate the entire page cache held
> on the file. This is incorrect as it will trash the entire mapping
> tree that now tracks dirty state in exceptional entries in the radix
> tree slots.
> 
> What we are trying to do is remove cached pages (e.g from reads
> into holes) that sit in the radix tree over the range we are about
> to write to. Hence we should just limit the invalidation to the
> range we are about to overwrite.

Looks fine (for a broad defintion of "fine"):


Reviewed-by: Christoph Hellwig <hch@xxxxxx>

> +      * XXX: This is racy against mmap, and there's nothing we can do about
> +      * it. dax_do_io() should really do this invalidation internally as
> +      * it will know if we've allocated over a holei for this specific IO and
> +      * if so it needs to update the mapping tree and invalidate existing
> +      * PTEs over the newly allocated range. Remove this invalidation when
> +      * dax_do_io() is fixed up.

FYI, I've got a basically working version of an iomap based DAX I/O path
(still fails a few corner cases), and I'll see if I can add that to it.

<Prev in Thread] Current Thread [Next in Thread>