xfs
[Top] [All Lists]

Re: A blocksize problem about dax and ext4

To: Dan Williams <dan.j.williams@xxxxxxxxx>
Subject: Re: A blocksize problem about dax and ext4
From: Cholerae Hu <choleraehyq@xxxxxxxxx>
Date: Thu, 24 Dec 2015 10:36:01 +0800
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, "Elliott, Robert (Persistent Memory)" <elliott@xxxxxxx>, Ted Tso <tytso@xxxxxxx>, "adilger.kernel@xxxxxxxxx" <adilger.kernel@xxxxxxxxx>, "linux-nvdimm@xxxxxxxxxxxx" <linux-nvdimm@xxxxxxxxxxxx>, "linux-ext4@xxxxxxxxxxxxxxx" <linux-ext4@xxxxxxxxxxxxxxx>, "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=adlHIZaqZS5WVXJn4GvRAoHtqv+xq22vGoxuSQdhvK4=; b=hMGI5gwBMcq4gFZ/DQJQTz97i2mqCJAjMdC7Gp+zEI0O36oz1fXobkaPUEQ9/D5ha5 u3Er6nr6Z4NH2GZ2W/JJpbdAH8VAB/cW3ptv4tb1+XoN1+jtrPJc4qNzQAPLROcNZjua aehskRElZn+9TyHEIAtNkotd9M7/ax+bu/GkKY73Zq83zjlErq0L/JW3AjlWSG3BxbtX E1TW+TblO7Umlq7Pm/DoZpWWXBZl2vPit530k9rgHj1avrDBJ5te6midO+GXElNXd+XX pi6aLpuidjdN2YW7PXoITGwVi6bTCAdtrCRiKcTxT7RpyOutqX5TmTYJmujNXbo6vjFr kRIA==
In-reply-to: <CAPcyv4g1eHgm8oUvxFaJkRD-T7jAyw95FQ-q3_GC2JU_kkU-Kg@xxxxxxxxxxxxxx>
References: <CAM=YXF-aXxp19=uFDExUswpEfKXNN6LJScxAB-7-u-AgRiXJ2g@xxxxxxxxxxxxxx> <CAPcyv4gYHuSWuugnELSO6B1rye+b89io3zJVUXwRt0wE1ZfPrA@xxxxxxxxxxxxxx> <94D0CD8314A33A4D9D801C0FE68B40295BEC985F@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20151224000021.GU19802@dastard> <CAM=YXF9Dt-BuY9yM7d023a16gp=edGHeCDVTCwV-AEotj6sbFg@xxxxxxxxxxxxxx> <CAPcyv4g1eHgm8oUvxFaJkRD-T7jAyw95FQ-q3_GC2JU_kkU-Kg@xxxxxxxxxxxxxx>
xfs will silently disable dax when the fs block size is too small,
i.e. your mmap() operations are backed by page cache in this case.
Currently the only indication of whether a mapping is DAX backed or
not is the presence of the VM_MIXEDMAP flag ("mm" in the VmFlags field
of /proc/<pid>/smaps)

Did you mean that I should make the blocksize bigger until the mount command tell me that dax is enabled?

I have tried to set blocksize to 2048/4096/8192. When 2048/4096 the mount command remained silent, when 8192 it prompted:

$ sudo mkfs.xfs -f -b size=8192 /dev/pmem0
meta-data="" Â Â Â Â Â Â isize=512 Â Âagcount=4, agsize=4096 blks
    Â=            sectsz=512  attr=2, projid32bit=1
    Â=            crc=1    Âfinobt=1
data   =            bsize=8192  blocks=16384, imaxpct=25
    Â=            sunit=0   Âswidth=0 blks
naming  =version 2       Âbsize=8192  ascii-ci=0 ftype=1
log   Â=internal log      bsize=8192  blocks=558, version=2
    Â=            sectsz=512  sunit=0 blks, lazy-count=1
realtime =none          extsz=8192  blocks=0, rtextents=0

$ sudo mount -o dax /dev/pmem0 /mnt/mem
mount: mount /dev/pmem0 on /mnt/mem failed: Function not implemented

2015-12-24 8:58 GMT+08:00 Dan Williams <dan.j.williams@xxxxxxxxx>:
On Wed, Dec 23, 2015 at 4:34 PM, Cholerae Hu <choleraehyq@xxxxxxxxx> wrote:
> The block size is 1024.
> # dumpe2fs -h /dev/pmem0 | grep "Block size"
> dumpe2fs 1.42.13 (17-May-2015)
> Block size:Â Â Â Â Â Â Â Â1024
>
> I tried it out on xfs and I succeeded. There are the prompting messages:
> # mkfs.xfs -f -b size=1024 /dev/pmem0
> meta-data="" Â Â Â Â Â Âisize=512Â Â agcount=4, agsize=32768 blks
>Â Â Â Â Â =Â Â Â Â Â Â Â Â Â Â Â Âsectsz=512Â Âattr=2, projid32bit=1
>Â Â Â Â Â =Â Â Â Â Â Â Â Â Â Â Â Âcrc=1Â Â Â Â finobt=1
> data  Â=           Âbsize=1024 Âblocks=131072, imaxpct=25
>Â Â Â Â Â =Â Â Â Â Â Â Â Â Â Â Â Âsunit=0Â Â Â swidth=0 blks
> naming Â=version 2       bsize=4096 Âascii-ci=0 ftype=1
> log   =internal log     Âbsize=1024 Âblocks=2571, version=2
>Â Â Â Â Â =Â Â Â Â Â Â Â Â Â Â Â Âsectsz=512Â Âsunit=0 blks, lazy-count=1
> realtime =none         Âextsz=4096 Âblocks=0, rtextents=0
> # mount -o dax /dev/pmem0 /mnt/mem
>
> The mount command doesn't return any message, and I can successfully read or
> write files in /mnt/mem.
>

xfs will silently disable dax when the fs block size is too small,
i.e. your mmap() operations are backed by page cache in this case.
Currently the only indication of whether a mapping is DAX backed or
not is the presence of the VM_MIXEDMAP flag ("mm" in the VmFlags field
of /proc/<pid>/smaps)

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