On Sun, Nov 8, 2020 at 5:35 PM Darrick J. Wong <darrick.wong(a)oracle.com> wrote:
On Sun, Nov 08, 2020 at 05:15:55PM -0800, Amy Parker wrote:
> I've been writing a patch to migrate the defined DAX_ZERO_PAGE
> to XA_ZERO_ENTRY for representing holes in files.
Why? IIRC XA_ZERO_ENTRY ("no mapping in the address space") isn't the
same as DAX_ZERO_PAGE ("the zero page is mapped into the address space
because we took a read fault on a sparse file hole").
Matthew recommended that we use a single entry here instead of adding
extra unnecessary definitions:
Right now, fs/dax.c uses a bit -- DAX_ZERO_PAGE --
to represent a hole in the file. It could equally well use a single entry,
and we already have one defined, XA_ZERO_ENTRY. I think a patch to
convert it over would be a great idea.
In practice, it works perfectly fine - ran a qemu instance with a 20 GiB
NVDIMM, set up a standard namespace and ran XFS with DAX enabled
on it, and then passed over it with xfstests. Nothing changed versus
the current effect.