diff mbox series

[4/4] xfs/260: Move xfs/260 to generic

Message ID 20200603140115.30392-4-yangx.jy@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show
Series [1/4] common/rc: Introduce new helpers for DAX mount options and FS_XFLAG_DAX | expand

Commit Message

Xiao Yang June 3, 2020, 2:01 p.m. UTC
Both ext4 and xfs support per-inode DAX flag now so move it to generic.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tests/{xfs/260 => generic/602} | 12 ++++++++----
 tests/generic/602.out          |  2 ++
 tests/generic/group            |  1 +
 tests/xfs/260.out              |  2 --
 tests/xfs/group                |  1 -
 5 files changed, 11 insertions(+), 7 deletions(-)
 rename tests/{xfs/260 => generic/602} (91%)
 create mode 100644 tests/generic/602.out
 delete mode 100644 tests/xfs/260.out

Comments

Darrick J. Wong June 9, 2020, 4:42 p.m. UTC | #1
On Wed, Jun 03, 2020 at 10:01:15PM +0800, Xiao Yang wrote:
> Both ext4 and xfs support per-inode DAX flag now so move it to generic.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  tests/{xfs/260 => generic/602} | 12 ++++++++----
>  tests/generic/602.out          |  2 ++
>  tests/generic/group            |  1 +
>  tests/xfs/260.out              |  2 --
>  tests/xfs/group                |  1 -
>  5 files changed, 11 insertions(+), 7 deletions(-)
>  rename tests/{xfs/260 => generic/602} (91%)
>  create mode 100644 tests/generic/602.out
>  delete mode 100644 tests/xfs/260.out
> 
> diff --git a/tests/xfs/260 b/tests/generic/602
> similarity index 91%
> rename from tests/xfs/260
> rename to tests/generic/602
> index fbdc4cd8..0cd20f31 100755
> --- a/tests/xfs/260
> +++ b/tests/generic/602
> @@ -2,7 +2,7 @@
>  # SPDX-License-Identifier: GPL-2.0
>  # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
>  #
> -# FS QA Test 260
> +# FS QA Test 602
>  #
>  # Test per-inode DAX flag by mmap direct/buffered IO.
>  #
> @@ -28,7 +28,7 @@ _cleanup()
>  # remove previous $seqres.full before test
>  rm -f $seqres.full
>  
> -_supported_fs xfs
> +_supported_fs generic
>  _supported_os Linux
>  _require_scratch_dax_mountopt "dax"
>  _require_test_program "feature"
> @@ -121,8 +121,12 @@ do_tests()
>  	t_dax_flag_mmap_dio $((64 * 1024 * 1024))
>  }
>  
> -# make xfs 2Mb aligned for PMD fault testing
> -_scratch_mkfs "-d su=2m,sw=1" > /dev/null 2>&1
> +# make 2Mb aligned for PMD fault testing
> +mkfs_opts=""
> +[ "$FSTYP" = "ext4" ] && mkfs_opts="-E stride=512,stripe_width=1"
> +[ "$FSTYP" = "xfs" ] && mkfs_opts="-d su=2m,sw=1"

/me wonders if this ought to be smart enough to sniff out the hugepage
size on the test machine...

--D

> +
> +_scratch_mkfs "$mkfs_opts" > /dev/null 2>&1
>  
>  # mount with dax option
>  _scratch_mount "-o dax"
> diff --git a/tests/generic/602.out b/tests/generic/602.out
> new file mode 100644
> index 00000000..61976e5e
> --- /dev/null
> +++ b/tests/generic/602.out
> @@ -0,0 +1,2 @@
> +QA output created by 602
> +Silence is golden
> diff --git a/tests/generic/group b/tests/generic/group
> index c6ce029c..4bda3772 100644
> --- a/tests/generic/group
> +++ b/tests/generic/group
> @@ -604,3 +604,4 @@
>  599 auto quick remount shutdown
>  600 auto quick quota
>  601 auto quick quota
> +602 auto attr quick dax
> diff --git a/tests/xfs/260.out b/tests/xfs/260.out
> deleted file mode 100644
> index 18ca517c..00000000
> --- a/tests/xfs/260.out
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -QA output created by 260
> -Silence is golden
> diff --git a/tests/xfs/group b/tests/xfs/group
> index daf54add..71c30898 100644
> --- a/tests/xfs/group
> +++ b/tests/xfs/group
> @@ -257,7 +257,6 @@
>  257 auto quick clone
>  258 auto quick clone
>  259 auto quick
> -260 auto attr quick dax
>  261 auto quick quota
>  262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
>  263 auto quick quota
> -- 
> 2.21.0
> 
> 
>
Xiao Yang June 10, 2020, 6:16 a.m. UTC | #2
On 2020/6/10 0:42, Darrick J. Wong wrote:
> On Wed, Jun 03, 2020 at 10:01:15PM +0800, Xiao Yang wrote:
>> Both ext4 and xfs support per-inode DAX flag now so move it to generic.
>>
>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>> ---
>>   tests/{xfs/260 =>  generic/602} | 12 ++++++++----
>>   tests/generic/602.out          |  2 ++
>>   tests/generic/group            |  1 +
>>   tests/xfs/260.out              |  2 --
>>   tests/xfs/group                |  1 -
>>   5 files changed, 11 insertions(+), 7 deletions(-)
>>   rename tests/{xfs/260 =>  generic/602} (91%)
>>   create mode 100644 tests/generic/602.out
>>   delete mode 100644 tests/xfs/260.out
>>
>> diff --git a/tests/xfs/260 b/tests/generic/602
>> similarity index 91%
>> rename from tests/xfs/260
>> rename to tests/generic/602
>> index fbdc4cd8..0cd20f31 100755
>> --- a/tests/xfs/260
>> +++ b/tests/generic/602
>> @@ -2,7 +2,7 @@
>>   # SPDX-License-Identifier: GPL-2.0
>>   # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
>>   #
>> -# FS QA Test 260
>> +# FS QA Test 602
>>   #
>>   # Test per-inode DAX flag by mmap direct/buffered IO.
>>   #
>> @@ -28,7 +28,7 @@ _cleanup()
>>   # remove previous $seqres.full before test
>>   rm -f $seqres.full
>>
>> -_supported_fs xfs
>> +_supported_fs generic
>>   _supported_os Linux
>>   _require_scratch_dax_mountopt "dax"
>>   _require_test_program "feature"
>> @@ -121,8 +121,12 @@ do_tests()
>>   	t_dax_flag_mmap_dio $((64 * 1024 * 1024))
>>   }
>>
>> -# make xfs 2Mb aligned for PMD fault testing
>> -_scratch_mkfs "-d su=2m,sw=1">  /dev/null 2>&1
>> +# make 2Mb aligned for PMD fault testing
>> +mkfs_opts=""
>> +[ "$FSTYP" = "ext4" ]&&  mkfs_opts="-E stride=512,stripe_width=1"
>> +[ "$FSTYP" = "xfs" ]&&  mkfs_opts="-d su=2m,sw=1"
>
> /me wonders if this ought to be smart enough to sniff out the hugepage
> size on the test machine...
Hi Darrick,

PMD page is always 2M, I am not sure why we need to sniff out the 
hugepage size?  Could you give me an example?

Best Regards,
Xiao Yang
>
> --D
>
>> +
>> +_scratch_mkfs "$mkfs_opts">  /dev/null 2>&1
>>
>>   # mount with dax option
>>   _scratch_mount "-o dax"
>> diff --git a/tests/generic/602.out b/tests/generic/602.out
>> new file mode 100644
>> index 00000000..61976e5e
>> --- /dev/null
>> +++ b/tests/generic/602.out
>> @@ -0,0 +1,2 @@
>> +QA output created by 602
>> +Silence is golden
>> diff --git a/tests/generic/group b/tests/generic/group
>> index c6ce029c..4bda3772 100644
>> --- a/tests/generic/group
>> +++ b/tests/generic/group
>> @@ -604,3 +604,4 @@
>>   599 auto quick remount shutdown
>>   600 auto quick quota
>>   601 auto quick quota
>> +602 auto attr quick dax
>> diff --git a/tests/xfs/260.out b/tests/xfs/260.out
>> deleted file mode 100644
>> index 18ca517c..00000000
>> --- a/tests/xfs/260.out
>> +++ /dev/null
>> @@ -1,2 +0,0 @@
>> -QA output created by 260
>> -Silence is golden
>> diff --git a/tests/xfs/group b/tests/xfs/group
>> index daf54add..71c30898 100644
>> --- a/tests/xfs/group
>> +++ b/tests/xfs/group
>> @@ -257,7 +257,6 @@
>>   257 auto quick clone
>>   258 auto quick clone
>>   259 auto quick
>> -260 auto attr quick dax
>>   261 auto quick quota
>>   262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
>>   263 auto quick quota
>> --
>> 2.21.0
>>
>>
>>
>
>
> .
>
Darrick J. Wong June 10, 2020, 3:59 p.m. UTC | #3
On Wed, Jun 10, 2020 at 02:16:45PM +0800, Xiao Yang wrote:
> On 2020/6/10 0:42, Darrick J. Wong wrote:
> > On Wed, Jun 03, 2020 at 10:01:15PM +0800, Xiao Yang wrote:
> > > Both ext4 and xfs support per-inode DAX flag now so move it to generic.
> > > 
> > > Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> > > ---
> > >   tests/{xfs/260 =>  generic/602} | 12 ++++++++----
> > >   tests/generic/602.out          |  2 ++
> > >   tests/generic/group            |  1 +
> > >   tests/xfs/260.out              |  2 --
> > >   tests/xfs/group                |  1 -
> > >   5 files changed, 11 insertions(+), 7 deletions(-)
> > >   rename tests/{xfs/260 =>  generic/602} (91%)
> > >   create mode 100644 tests/generic/602.out
> > >   delete mode 100644 tests/xfs/260.out
> > > 
> > > diff --git a/tests/xfs/260 b/tests/generic/602
> > > similarity index 91%
> > > rename from tests/xfs/260
> > > rename to tests/generic/602
> > > index fbdc4cd8..0cd20f31 100755
> > > --- a/tests/xfs/260
> > > +++ b/tests/generic/602
> > > @@ -2,7 +2,7 @@
> > >   # SPDX-License-Identifier: GPL-2.0
> > >   # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
> > >   #
> > > -# FS QA Test 260
> > > +# FS QA Test 602
> > >   #
> > >   # Test per-inode DAX flag by mmap direct/buffered IO.
> > >   #
> > > @@ -28,7 +28,7 @@ _cleanup()
> > >   # remove previous $seqres.full before test
> > >   rm -f $seqres.full
> > > 
> > > -_supported_fs xfs
> > > +_supported_fs generic
> > >   _supported_os Linux
> > >   _require_scratch_dax_mountopt "dax"
> > >   _require_test_program "feature"
> > > @@ -121,8 +121,12 @@ do_tests()
> > >   	t_dax_flag_mmap_dio $((64 * 1024 * 1024))
> > >   }
> > > 
> > > -# make xfs 2Mb aligned for PMD fault testing
> > > -_scratch_mkfs "-d su=2m,sw=1">  /dev/null 2>&1
> > > +# make 2Mb aligned for PMD fault testing
> > > +mkfs_opts=""
> > > +[ "$FSTYP" = "ext4" ]&&  mkfs_opts="-E stride=512,stripe_width=1"
> > > +[ "$FSTYP" = "xfs" ]&&  mkfs_opts="-d su=2m,sw=1"
> > 
> > /me wonders if this ought to be smart enough to sniff out the hugepage
> > size on the test machine...
> Hi Darrick,
> 
> PMD page is always 2M, I am not sure why we need to sniff out the hugepage
> size?  Could you give me an example?

arm64, which can have 512M hugepages.
ppc64, which can have 16M huge pages (I think?)

--D

> Best Regards,
> Xiao Yang
> > 
> > --D
> > 
> > > +
> > > +_scratch_mkfs "$mkfs_opts">  /dev/null 2>&1
> > > 
> > >   # mount with dax option
> > >   _scratch_mount "-o dax"
> > > diff --git a/tests/generic/602.out b/tests/generic/602.out
> > > new file mode 100644
> > > index 00000000..61976e5e
> > > --- /dev/null
> > > +++ b/tests/generic/602.out
> > > @@ -0,0 +1,2 @@
> > > +QA output created by 602
> > > +Silence is golden
> > > diff --git a/tests/generic/group b/tests/generic/group
> > > index c6ce029c..4bda3772 100644
> > > --- a/tests/generic/group
> > > +++ b/tests/generic/group
> > > @@ -604,3 +604,4 @@
> > >   599 auto quick remount shutdown
> > >   600 auto quick quota
> > >   601 auto quick quota
> > > +602 auto attr quick dax
> > > diff --git a/tests/xfs/260.out b/tests/xfs/260.out
> > > deleted file mode 100644
> > > index 18ca517c..00000000
> > > --- a/tests/xfs/260.out
> > > +++ /dev/null
> > > @@ -1,2 +0,0 @@
> > > -QA output created by 260
> > > -Silence is golden
> > > diff --git a/tests/xfs/group b/tests/xfs/group
> > > index daf54add..71c30898 100644
> > > --- a/tests/xfs/group
> > > +++ b/tests/xfs/group
> > > @@ -257,7 +257,6 @@
> > >   257 auto quick clone
> > >   258 auto quick clone
> > >   259 auto quick
> > > -260 auto attr quick dax
> > >   261 auto quick quota
> > >   262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
> > >   263 auto quick quota
> > > --
> > > 2.21.0
> > > 
> > > 
> > > 
> > 
> > 
> > .
> > 
> 
> 
>
Xiao Yang June 11, 2020, 8:33 a.m. UTC | #4
On 2020/6/10 23:59, Darrick J. Wong wrote:
> On Wed, Jun 10, 2020 at 02:16:45PM +0800, Xiao Yang wrote:
>> On 2020/6/10 0:42, Darrick J. Wong wrote:
>>> On Wed, Jun 03, 2020 at 10:01:15PM +0800, Xiao Yang wrote:
>>>> Both ext4 and xfs support per-inode DAX flag now so move it to generic.
>>>>
>>>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>>>> ---
>>>>    tests/{xfs/260 =>   generic/602} | 12 ++++++++----
>>>>    tests/generic/602.out          |  2 ++
>>>>    tests/generic/group            |  1 +
>>>>    tests/xfs/260.out              |  2 --
>>>>    tests/xfs/group                |  1 -
>>>>    5 files changed, 11 insertions(+), 7 deletions(-)
>>>>    rename tests/{xfs/260 =>   generic/602} (91%)
>>>>    create mode 100644 tests/generic/602.out
>>>>    delete mode 100644 tests/xfs/260.out
>>>>
>>>> diff --git a/tests/xfs/260 b/tests/generic/602
>>>> similarity index 91%
>>>> rename from tests/xfs/260
>>>> rename to tests/generic/602
>>>> index fbdc4cd8..0cd20f31 100755
>>>> --- a/tests/xfs/260
>>>> +++ b/tests/generic/602
>>>> @@ -2,7 +2,7 @@
>>>>    # SPDX-License-Identifier: GPL-2.0
>>>>    # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
>>>>    #
>>>> -# FS QA Test 260
>>>> +# FS QA Test 602
>>>>    #
>>>>    # Test per-inode DAX flag by mmap direct/buffered IO.
>>>>    #
>>>> @@ -28,7 +28,7 @@ _cleanup()
>>>>    # remove previous $seqres.full before test
>>>>    rm -f $seqres.full
>>>>
>>>> -_supported_fs xfs
>>>> +_supported_fs generic
>>>>    _supported_os Linux
>>>>    _require_scratch_dax_mountopt "dax"
>>>>    _require_test_program "feature"
>>>> @@ -121,8 +121,12 @@ do_tests()
>>>>    	t_dax_flag_mmap_dio $((64 * 1024 * 1024))
>>>>    }
>>>>
>>>> -# make xfs 2Mb aligned for PMD fault testing
>>>> -_scratch_mkfs "-d su=2m,sw=1">   /dev/null 2>&1
>>>> +# make 2Mb aligned for PMD fault testing
>>>> +mkfs_opts=""
>>>> +[ "$FSTYP" = "ext4" ]&&   mkfs_opts="-E stride=512,stripe_width=1"
>>>> +[ "$FSTYP" = "xfs" ]&&   mkfs_opts="-d su=2m,sw=1"
>>>
>>> /me wonders if this ought to be smart enough to sniff out the hugepage
>>> size on the test machine...
>> Hi Darrick,
>>
>> PMD page is always 2M, I am not sure why we need to sniff out the hugepage
>> size?  Could you give me an example?
>
> arm64, which can have 512M hugepages.
> ppc64, which can have 16M huge pages (I think?)
Hi Darrick,

Sorry I don't understand what you mean.
I know different arches have different page size/hugepage size but I 
don't know the relationship between PMD page fault and hugepage.

Accodring to dax.txt in kernel, it seems that we have to format block 
device with a fixed block size which is equal to kernel's page size.
mount will fail or disable dax feature if block size is not equal to
kernel's page size, so do you mean this?

Best Regards,
Xiao Yang
>
> --D
>
>> Best Regards,
>> Xiao Yang
>>>
>>> --D
>>>
>>>> +
>>>> +_scratch_mkfs "$mkfs_opts">   /dev/null 2>&1
>>>>
>>>>    # mount with dax option
>>>>    _scratch_mount "-o dax"
>>>> diff --git a/tests/generic/602.out b/tests/generic/602.out
>>>> new file mode 100644
>>>> index 00000000..61976e5e
>>>> --- /dev/null
>>>> +++ b/tests/generic/602.out
>>>> @@ -0,0 +1,2 @@
>>>> +QA output created by 602
>>>> +Silence is golden
>>>> diff --git a/tests/generic/group b/tests/generic/group
>>>> index c6ce029c..4bda3772 100644
>>>> --- a/tests/generic/group
>>>> +++ b/tests/generic/group
>>>> @@ -604,3 +604,4 @@
>>>>    599 auto quick remount shutdown
>>>>    600 auto quick quota
>>>>    601 auto quick quota
>>>> +602 auto attr quick dax
>>>> diff --git a/tests/xfs/260.out b/tests/xfs/260.out
>>>> deleted file mode 100644
>>>> index 18ca517c..00000000
>>>> --- a/tests/xfs/260.out
>>>> +++ /dev/null
>>>> @@ -1,2 +0,0 @@
>>>> -QA output created by 260
>>>> -Silence is golden
>>>> diff --git a/tests/xfs/group b/tests/xfs/group
>>>> index daf54add..71c30898 100644
>>>> --- a/tests/xfs/group
>>>> +++ b/tests/xfs/group
>>>> @@ -257,7 +257,6 @@
>>>>    257 auto quick clone
>>>>    258 auto quick clone
>>>>    259 auto quick
>>>> -260 auto attr quick dax
>>>>    261 auto quick quota
>>>>    262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
>>>>    263 auto quick quota
>>>> --
>>>> 2.21.0
>>>>
>>>>
>>>>
>>>
>>>
>>> .
>>>
>>
>>
>>
>
>
> .
>
Xiao Yang June 11, 2020, 9:13 a.m. UTC | #5
On 2020/6/10 23:59, Darrick J. Wong wrote:
> On Wed, Jun 10, 2020 at 02:16:45PM +0800, Xiao Yang wrote:
>> On 2020/6/10 0:42, Darrick J. Wong wrote:
>>> On Wed, Jun 03, 2020 at 10:01:15PM +0800, Xiao Yang wrote:
>>>> Both ext4 and xfs support per-inode DAX flag now so move it to generic.
>>>>
>>>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>>>> ---
>>>>    tests/{xfs/260 =>   generic/602} | 12 ++++++++----
>>>>    tests/generic/602.out          |  2 ++
>>>>    tests/generic/group            |  1 +
>>>>    tests/xfs/260.out              |  2 --
>>>>    tests/xfs/group                |  1 -
>>>>    5 files changed, 11 insertions(+), 7 deletions(-)
>>>>    rename tests/{xfs/260 =>   generic/602} (91%)
>>>>    create mode 100644 tests/generic/602.out
>>>>    delete mode 100644 tests/xfs/260.out
>>>>
>>>> diff --git a/tests/xfs/260 b/tests/generic/602
>>>> similarity index 91%
>>>> rename from tests/xfs/260
>>>> rename to tests/generic/602
>>>> index fbdc4cd8..0cd20f31 100755
>>>> --- a/tests/xfs/260
>>>> +++ b/tests/generic/602
>>>> @@ -2,7 +2,7 @@
>>>>    # SPDX-License-Identifier: GPL-2.0
>>>>    # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
>>>>    #
>>>> -# FS QA Test 260
>>>> +# FS QA Test 602
>>>>    #
>>>>    # Test per-inode DAX flag by mmap direct/buffered IO.
>>>>    #
>>>> @@ -28,7 +28,7 @@ _cleanup()
>>>>    # remove previous $seqres.full before test
>>>>    rm -f $seqres.full
>>>>
>>>> -_supported_fs xfs
>>>> +_supported_fs generic
>>>>    _supported_os Linux
>>>>    _require_scratch_dax_mountopt "dax"
>>>>    _require_test_program "feature"
>>>> @@ -121,8 +121,12 @@ do_tests()
>>>>    	t_dax_flag_mmap_dio $((64 * 1024 * 1024))
>>>>    }
>>>>
>>>> -# make xfs 2Mb aligned for PMD fault testing
>>>> -_scratch_mkfs "-d su=2m,sw=1">   /dev/null 2>&1
>>>> +# make 2Mb aligned for PMD fault testing
>>>> +mkfs_opts=""
>>>> +[ "$FSTYP" = "ext4" ]&&   mkfs_opts="-E stride=512,stripe_width=1"
>>>> +[ "$FSTYP" = "xfs" ]&&   mkfs_opts="-d su=2m,sw=1"
>>> /me wonders if this ought to be smart enough to sniff out the hugepage
>>> size on the test machine...
>> Hi Darrick,
>>
>> PMD page is always 2M, I am not sure why we need to sniff out the hugepage
>> size?  Could you give me an example?
> arm64, which can have 512M hugepages.
> ppc64, which can have 16M huge pages (I think?)
Hi Darrick,

After reading kernel xfs code, do you mean that PMD page fault is only 
used by hugepage?
----------------------------------------------------------------
xfs/xfs_file.c:
...
1223 static vm_fault_t
1224 xfs_filemap_fault(
1225         struct vm_fault         *vmf)
1226 {
1227         /* DAX can shortcut the normal fault path on write faults! */
1228         return __xfs_filemap_fault(vmf, PE_SIZE_PTE,
1229                         IS_DAX(file_inode(vmf->vma->vm_file)) &&
1230                         (vmf->flags & FAULT_FLAG_WRITE));
1231 }
1232
1233 static vm_fault_t
1234 xfs_filemap_huge_fault(
1235         struct vm_fault         *vmf,
1236         enum page_entry_size    pe_size)
1237 {
1238         if (!IS_DAX(file_inode(vmf->vma->vm_file)))
1239                 return VM_FAULT_FALLBACK;
1240
1241         /* DAX can shortcut the normal fault path on write faults! */
1242         return __xfs_filemap_fault(vmf, pe_size,
1243                         (vmf->flags & FAULT_FLAG_WRITE));
1244 }
...
----------------------------------------------------------------

Another qeustion: ext4 seems not use PMD page fault,does I miss something?
----------------------------------------------------------------
ext4/file.c:
...
705 static vm_fault_t ext4_dax_fault(struct vm_fault *vmf)
706 {
707         return ext4_dax_huge_fault(vmf, PE_SIZE_PTE);
708 }
709
710 static const struct vm_operations_struct ext4_dax_vm_ops = {
711         .fault          = ext4_dax_fault,
712         .huge_fault     = ext4_dax_huge_fault,
...
----------------------------------------------------------------

Best Regards,
Xiao Yang
> --D
>
>> Best Regards,
>> Xiao Yang
>>> --D
>>>
>>>> +
>>>> +_scratch_mkfs "$mkfs_opts">   /dev/null 2>&1
>>>>
>>>>    # mount with dax option
>>>>    _scratch_mount "-o dax"
>>>> diff --git a/tests/generic/602.out b/tests/generic/602.out
>>>> new file mode 100644
>>>> index 00000000..61976e5e
>>>> --- /dev/null
>>>> +++ b/tests/generic/602.out
>>>> @@ -0,0 +1,2 @@
>>>> +QA output created by 602
>>>> +Silence is golden
>>>> diff --git a/tests/generic/group b/tests/generic/group
>>>> index c6ce029c..4bda3772 100644
>>>> --- a/tests/generic/group
>>>> +++ b/tests/generic/group
>>>> @@ -604,3 +604,4 @@
>>>>    599 auto quick remount shutdown
>>>>    600 auto quick quota
>>>>    601 auto quick quota
>>>> +602 auto attr quick dax
>>>> diff --git a/tests/xfs/260.out b/tests/xfs/260.out
>>>> deleted file mode 100644
>>>> index 18ca517c..00000000
>>>> --- a/tests/xfs/260.out
>>>> +++ /dev/null
>>>> @@ -1,2 +0,0 @@
>>>> -QA output created by 260
>>>> -Silence is golden
>>>> diff --git a/tests/xfs/group b/tests/xfs/group
>>>> index daf54add..71c30898 100644
>>>> --- a/tests/xfs/group
>>>> +++ b/tests/xfs/group
>>>> @@ -257,7 +257,6 @@
>>>>    257 auto quick clone
>>>>    258 auto quick clone
>>>>    259 auto quick
>>>> -260 auto attr quick dax
>>>>    261 auto quick quota
>>>>    262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
>>>>    263 auto quick quota
>>>> --
>>>> 2.21.0
>>>>
>>>>
>>>>
>>>
>>> .
>>>
>>
>>
>
> .
>
Xiao Yang June 11, 2020, 2:19 p.m. UTC | #6
On 2020/6/11 17:13, Xiao Yang wrote:
> On 2020/6/10 23:59, Darrick J. Wong wrote:
>> On Wed, Jun 10, 2020 at 02:16:45PM +0800, Xiao Yang wrote:
>>> On 2020/6/10 0:42, Darrick J. Wong wrote:
>>>> On Wed, Jun 03, 2020 at 10:01:15PM +0800, Xiao Yang wrote:
>>>>> Both ext4 and xfs support per-inode DAX flag now so move it to 
>>>>> generic.
>>>>>
>>>>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>>>>> ---
>>>>>    tests/{xfs/260 =>   generic/602} | 12 ++++++++----
>>>>>    tests/generic/602.out          |  2 ++
>>>>>    tests/generic/group            |  1 +
>>>>>    tests/xfs/260.out              |  2 --
>>>>>    tests/xfs/group                |  1 -
>>>>>    5 files changed, 11 insertions(+), 7 deletions(-)
>>>>>    rename tests/{xfs/260 =>   generic/602} (91%)
>>>>>    create mode 100644 tests/generic/602.out
>>>>>    delete mode 100644 tests/xfs/260.out
>>>>>
>>>>> diff --git a/tests/xfs/260 b/tests/generic/602
>>>>> similarity index 91%
>>>>> rename from tests/xfs/260
>>>>> rename to tests/generic/602
>>>>> index fbdc4cd8..0cd20f31 100755
>>>>> --- a/tests/xfs/260
>>>>> +++ b/tests/generic/602
>>>>> @@ -2,7 +2,7 @@
>>>>>    # SPDX-License-Identifier: GPL-2.0
>>>>>    # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
>>>>>    #
>>>>> -# FS QA Test 260
>>>>> +# FS QA Test 602
>>>>>    #
>>>>>    # Test per-inode DAX flag by mmap direct/buffered IO.
>>>>>    #
>>>>> @@ -28,7 +28,7 @@ _cleanup()
>>>>>    # remove previous $seqres.full before test
>>>>>    rm -f $seqres.full
>>>>>
>>>>> -_supported_fs xfs
>>>>> +_supported_fs generic
>>>>>    _supported_os Linux
>>>>>    _require_scratch_dax_mountopt "dax"
>>>>>    _require_test_program "feature"
>>>>> @@ -121,8 +121,12 @@ do_tests()
>>>>>        t_dax_flag_mmap_dio $((64 * 1024 * 1024))
>>>>>    }
>>>>>
>>>>> -# make xfs 2Mb aligned for PMD fault testing
>>>>> -_scratch_mkfs "-d su=2m,sw=1">   /dev/null 2>&1
>>>>> +# make 2Mb aligned for PMD fault testing
>>>>> +mkfs_opts=""
>>>>> +[ "$FSTYP" = "ext4" ]&&   mkfs_opts="-E stride=512,stripe_width=1"
>>>>> +[ "$FSTYP" = "xfs" ]&&   mkfs_opts="-d su=2m,sw=1"
>>>> /me wonders if this ought to be smart enough to sniff out the hugepage
>>>> size on the test machine...
>>> Hi Darrick,
>>>
>>> PMD page is always 2M, I am not sure why we need to sniff out the 
>>> hugepage
>>> size?  Could you give me an example?
>> arm64, which can have 512M hugepages.
>> ppc64, which can have 16M huge pages (I think?)
> Hi Darrick,
>
> After reading kernel xfs code, do you mean that PMD page fault is only 
> used by hugepage?
> ----------------------------------------------------------------
> xfs/xfs_file.c:
> ...
> 1223 static vm_fault_t
> 1224 xfs_filemap_fault(
> 1225         struct vm_fault         *vmf)
> 1226 {
> 1227         /* DAX can shortcut the normal fault path on write 
> faults! */
> 1228         return __xfs_filemap_fault(vmf, PE_SIZE_PTE,
> 1229                         IS_DAX(file_inode(vmf->vma->vm_file)) &&
> 1230                         (vmf->flags & FAULT_FLAG_WRITE));
> 1231 }
> 1232
> 1233 static vm_fault_t
> 1234 xfs_filemap_huge_fault(
> 1235         struct vm_fault         *vmf,
> 1236         enum page_entry_size    pe_size)
> 1237 {
> 1238         if (!IS_DAX(file_inode(vmf->vma->vm_file)))
> 1239                 return VM_FAULT_FALLBACK;
> 1240
> 1241         /* DAX can shortcut the normal fault path on write 
> faults! */
> 1242         return __xfs_filemap_fault(vmf, pe_size,
> 1243                         (vmf->flags & FAULT_FLAG_WRITE));
> 1244 }
> ...
> ----------------------------------------------------------------
>
> Another qeustion: ext4 seems not use PMD page fault,does I miss 
> something?
Hi,

Sorry, ext4 actually uses  PMD page fault as the following code does so 
please ignore the naive question. :-(

Thanks,
Xiao Yang
> ----------------------------------------------------------------
> ext4/file.c:
> ...
> 705 static vm_fault_t ext4_dax_fault(struct vm_fault *vmf)
> 706 {
> 707         return ext4_dax_huge_fault(vmf, PE_SIZE_PTE);
> 708 }
> 709
> 710 static const struct vm_operations_struct ext4_dax_vm_ops = {
> 711         .fault          = ext4_dax_fault,
> 712         .huge_fault     = ext4_dax_huge_fault,
> ...
> ----------------------------------------------------------------
>
> Best Regards,
> Xiao Yang
>> --D
>>
>>> Best Regards,
>>> Xiao Yang
>>>> --D
>>>>
>>>>> +
>>>>> +_scratch_mkfs "$mkfs_opts">   /dev/null 2>&1
>>>>>
>>>>>    # mount with dax option
>>>>>    _scratch_mount "-o dax"
>>>>> diff --git a/tests/generic/602.out b/tests/generic/602.out
>>>>> new file mode 100644
>>>>> index 00000000..61976e5e
>>>>> --- /dev/null
>>>>> +++ b/tests/generic/602.out
>>>>> @@ -0,0 +1,2 @@
>>>>> +QA output created by 602
>>>>> +Silence is golden
>>>>> diff --git a/tests/generic/group b/tests/generic/group
>>>>> index c6ce029c..4bda3772 100644
>>>>> --- a/tests/generic/group
>>>>> +++ b/tests/generic/group
>>>>> @@ -604,3 +604,4 @@
>>>>>    599 auto quick remount shutdown
>>>>>    600 auto quick quota
>>>>>    601 auto quick quota
>>>>> +602 auto attr quick dax
>>>>> diff --git a/tests/xfs/260.out b/tests/xfs/260.out
>>>>> deleted file mode 100644
>>>>> index 18ca517c..00000000
>>>>> --- a/tests/xfs/260.out
>>>>> +++ /dev/null
>>>>> @@ -1,2 +0,0 @@
>>>>> -QA output created by 260
>>>>> -Silence is golden
>>>>> diff --git a/tests/xfs/group b/tests/xfs/group
>>>>> index daf54add..71c30898 100644
>>>>> --- a/tests/xfs/group
>>>>> +++ b/tests/xfs/group
>>>>> @@ -257,7 +257,6 @@
>>>>>    257 auto quick clone
>>>>>    258 auto quick clone
>>>>>    259 auto quick
>>>>> -260 auto attr quick dax
>>>>>    261 auto quick quota
>>>>>    262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
>>>>>    263 auto quick quota
>>>>> -- 
>>>>> 2.21.0
>>>>>
>>>>>
>>>>>
>>>>
>>>> .
>>>>
>>>
>>>
>>
>> .
>>
>
>
>
> .
>
diff mbox series

Patch

diff --git a/tests/xfs/260 b/tests/generic/602
similarity index 91%
rename from tests/xfs/260
rename to tests/generic/602
index fbdc4cd8..0cd20f31 100755
--- a/tests/xfs/260
+++ b/tests/generic/602
@@ -2,7 +2,7 @@ 
 # SPDX-License-Identifier: GPL-2.0
 # Copyright (c) 2017 Red Hat Inc.  All Rights Reserved.
 #
-# FS QA Test 260
+# FS QA Test 602
 #
 # Test per-inode DAX flag by mmap direct/buffered IO.
 #
@@ -28,7 +28,7 @@  _cleanup()
 # remove previous $seqres.full before test
 rm -f $seqres.full
 
-_supported_fs xfs
+_supported_fs generic
 _supported_os Linux
 _require_scratch_dax_mountopt "dax"
 _require_test_program "feature"
@@ -121,8 +121,12 @@  do_tests()
 	t_dax_flag_mmap_dio $((64 * 1024 * 1024))
 }
 
-# make xfs 2Mb aligned for PMD fault testing
-_scratch_mkfs "-d su=2m,sw=1" > /dev/null 2>&1
+# make 2Mb aligned for PMD fault testing
+mkfs_opts=""
+[ "$FSTYP" = "ext4" ] && mkfs_opts="-E stride=512,stripe_width=1"
+[ "$FSTYP" = "xfs" ] && mkfs_opts="-d su=2m,sw=1"
+
+_scratch_mkfs "$mkfs_opts" > /dev/null 2>&1
 
 # mount with dax option
 _scratch_mount "-o dax"
diff --git a/tests/generic/602.out b/tests/generic/602.out
new file mode 100644
index 00000000..61976e5e
--- /dev/null
+++ b/tests/generic/602.out
@@ -0,0 +1,2 @@ 
+QA output created by 602
+Silence is golden
diff --git a/tests/generic/group b/tests/generic/group
index c6ce029c..4bda3772 100644
--- a/tests/generic/group
+++ b/tests/generic/group
@@ -604,3 +604,4 @@ 
 599 auto quick remount shutdown
 600 auto quick quota
 601 auto quick quota
+602 auto attr quick dax
diff --git a/tests/xfs/260.out b/tests/xfs/260.out
deleted file mode 100644
index 18ca517c..00000000
--- a/tests/xfs/260.out
+++ /dev/null
@@ -1,2 +0,0 @@ 
-QA output created by 260
-Silence is golden
diff --git a/tests/xfs/group b/tests/xfs/group
index daf54add..71c30898 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -257,7 +257,6 @@ 
 257 auto quick clone
 258 auto quick clone
 259 auto quick
-260 auto attr quick dax
 261 auto quick quota
 262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
 263 auto quick quota