From: Cholerae Hu Subject: Re: A blocksize problem about dax and ext4 Date: Thu, 24 Dec 2015 10:36:01 +0800 Message-ID: References: <94D0CD8314A33A4D9D801C0FE68B40295BEC985F@G9W0745.americas.hpqcorp.net> <20151224000021.GU19802@dastard> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1182287056083597788==" Cc: Ted Tso , "linux-nvdimm@lists.01.org" , "linux-kernel@vger.kernel.org" , "xfs@oss.sgi.com" , "adilger.kernel@dilger.ca" , "linux-ext4@vger.kernel.org" , "Elliott, Robert \(Persistent Memory\)" To: Dan Williams Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com List-Id: linux-ext4.vger.kernel.org --===============1182287056083597788== Content-Type: multipart/alternative; boundary=001a114fa8ac1d1a9b05279bb37a --001a114fa8ac1d1a9b05279bb37a Content-Type: text/plain; charset=UTF-8 > > 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//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=/dev/pmem0 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 : > On Wed, Dec 23, 2015 at 4:34 PM, Cholerae Hu > 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=/dev/pmem0 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//smaps) > --001a114fa8ac1d1a9b05279bb37a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
xfs will s= ilently 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 enab= led?

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

$ sudo mkfs.xfs -f -b size=3D8192 /dev/pmem0
meta-data=3D/dev/pmem0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 isiz= e=3D512 =C2=A0 =C2=A0agcount=3D4, agsize=3D4096 blks
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sectsz=3D512 =C2=A0 attr=3D2, projid32bit= =3D1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 crc=3D1 =C2=A0 =C2= =A0 =C2=A0 =C2=A0finobt=3D1
data =C2=A0 =C2=A0 =3D =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bsize=3D8192= =C2=A0 blocks=3D16384, imaxpct=3D25
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=3D =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 sunit=3D0 =C2=A0 =C2=A0 =C2=A0swidth=3D0 blks
namin= g =C2=A0 =3Dversion 2 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bsize= =3D8192 =C2=A0 ascii-ci=3D0 ftype=3D1
log =C2=A0 =C2=A0 =C2=A0=3D= internal log =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bsize=3D8192 =C2=A0 blocks= =3D558, version=3D2
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sects= z=3D512 =C2=A0 sunit=3D0 blks, lazy-count=3D1
realtime =3Dnone = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 extsz=3D8192= =C2=A0 blocks=3D0, rtextents=3D0

$ sudo mount -o = dax /dev/pmem0 /mnt/mem
mount: mount /dev/pmem0 on /mnt/mem faile= d: Function not implemented
2015-12-24 8:58 GMT+08:00 Dan Williams <dan.j.williams@intel.com>:
On Wed, Dec 23, 2015 at 4:34 PM, Cholerae Hu <choleraehyq@gmail.com> wrote:
> The block size is 1024.
> # dumpe2fs -h /dev/pmem0 | grep "Block size"
> dumpe2fs 1.42.13 (17-May-2015)
> Block size:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01024=
>
> I tried it out on xfs and I succeeded. There are the prompting message= s:
> # mkfs.xfs -f -b size=3D1024 /dev/pmem0
> meta-data=3D/dev/pmem0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= isize=3D512=C2=A0 =C2=A0 agcount=3D4, agsize=3D32768 blks
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sectsz=3D512=C2=A0 =C2= =A0attr=3D2, projid32bit=3D1
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0crc=3D1=C2=A0 =C2=A0 = =C2=A0 =C2=A0 finobt=3D1
> data=C2=A0 =C2=A0 =C2=A0=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bsize=3D1024=C2=A0 =C2=A0blocks=3D= 131072, imaxpct=3D25
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sunit=3D0=C2=A0 =C2=A0 = =C2=A0 swidth=3D0 blks
> naming=C2=A0 =C2=A0=3Dversion 2=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 bsize=3D4096=C2=A0 =C2=A0ascii-ci=3D0 ftype=3D1
> log=C2=A0 =C2=A0 =C2=A0 =3Dinternal log=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0bsize=3D1024=C2=A0 =C2=A0blocks=3D2571, version=3D2
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sectsz=3D512=C2=A0 =C2= =A0sunit=3D0 blks, lazy-count=3D1
> realtime =3Dnone=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0extsz=3D4096=C2=A0 =C2=A0blocks=3D0, rtextents=3D0
> # mount -o dax /dev/pmem0 /mnt/mem
>
> The mount command doesn't return any message, and I can successful= ly 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)

--001a114fa8ac1d1a9b05279bb37a-- --===============1182287056083597788== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs --===============1182287056083597788==--