[v1] test/dax.sh: correct the pmd pagefault counts generated by dax-pmd
diff mbox series

Message ID 20200320021255.1778-1-xifeng@redhat.com
State New
Headers show
Series
  • [v1] test/dax.sh: correct the pmd pagefault counts generated by dax-pmd
Related show

Commit Message

Xiaoli Feng March 20, 2020, 2:12 a.m. UTC
From: Xiaoli Feng <xifeng@redhat.com>

For directIO, cannot generate pmd pagefault by pread|pwrite|read|write
if do not map fd to memory. In dax-pmd.c, case 1 and case 4 each only
generate once pmd pagefault. So change the all counts from 10 to 8.

Signed-off-by: Xiaoli Feng <xifeng@redhat.com>
---
 test/dax.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Dan Williams March 20, 2020, 2:36 a.m. UTC | #1
On Thu, Mar 19, 2020 at 7:13 PM XiaoLi Feng <xifeng@redhat.com> wrote:
>
> From: Xiaoli Feng <xifeng@redhat.com>
>
> For directIO, cannot generate pmd pagefault by pread|pwrite|read|write
> if do not map fd to memory. In dax-pmd.c, case 1 and case 4 each only
> generate once pmd pagefault. So change the all counts from 10 to 8.

What kernel are you seeing this failure on? It's passing for me on v5.6-rc.
Xiaoli Feng March 20, 2020, 3:18 a.m. UTC | #2
Hi,

----- Original Message -----
> From: "Dan Williams" <dan.j.williams@intel.com>
> To: "XiaoLi Feng" <xifeng@redhat.com>
> Cc: "linux-nvdimm" <linux-nvdimm@lists.01.org>
> Sent: Friday, March 20, 2020 10:36:05 AM
> Subject: Re: [PATCH v1] test/dax.sh: correct the pmd pagefault counts generated by dax-pmd
> 
> On Thu, Mar 19, 2020 at 7:13 PM XiaoLi Feng <xifeng@redhat.com> wrote:
> >
> > From: Xiaoli Feng <xifeng@redhat.com>
> >
> > For directIO, cannot generate pmd pagefault by pread|pwrite|read|write
> > if do not map fd to memory. In dax-pmd.c, case 1 and case 4 each only
> > generate once pmd pagefault. So change the all counts from 10 to 8.
> 
> What kernel are you seeing this failure on? It's passing for me on v5.6-rc.

I test on v4.18. I will test on v5.6.

# make check-TESTS
PASS: libndctl
PASS: dsm-fail
PASS: dpa-alloc
PASS: parent-uuid
PASS: multi-pmem
PASS: create.sh
PASS: clear.sh
PASS: pmem-errors.sh
PASS: daxdev-errors.sh
PASS: multi-dax.sh
PASS: btt-check.sh
PASS: label-compat.sh
PASS: blk-exhaust.sh
PASS: sector-mode.sh
PASS: inject-error.sh
PASS: btt-errors.sh
PASS: hugetlb
PASS: btt-pad-compat.sh
PASS: firmware-update.sh
PASS: ack-shutdown-count-set
PASS: rescan-partitions.sh
SKIP: inject-smart.sh
PASS: monitor.sh
SKIP: max_available_extent_ns.sh
SKIP: pfn-meta-errors.sh
PASS: blk-ns
PASS: pmem-ns
PASS: dax-dev
FAIL: dax-ext4.sh
FAIL: dax-xfs.sh
PASS: device-dax
SKIP: device-dax-fio.sh
PASS: mmap.sh
SKIP: daxctl-devices.sh
SKIP: security.sh

...cut...

# grep -r "cleanup 66" -B 5 dax-ext4.sh.log
+ '[' NOPAGE '!=' 0x100 ']'
+ '[' NOPAGE '!=' NOPAGE ']'
+ count=8
+ read -r p
+ '[' 8 -lt 10 ']'
+ cleanup 66


> 
>
Dan Williams March 20, 2020, 3:37 a.m. UTC | #3
On Thu, Mar 19, 2020 at 8:19 PM Xiaoli Feng <xifeng@redhat.com> wrote:
>
> Hi,
>
> ----- Original Message -----
> > From: "Dan Williams" <dan.j.williams@intel.com>
> > To: "XiaoLi Feng" <xifeng@redhat.com>
> > Cc: "linux-nvdimm" <linux-nvdimm@lists.01.org>
> > Sent: Friday, March 20, 2020 10:36:05 AM
> > Subject: Re: [PATCH v1] test/dax.sh: correct the pmd pagefault counts generated by dax-pmd
> >
> > On Thu, Mar 19, 2020 at 7:13 PM XiaoLi Feng <xifeng@redhat.com> wrote:
> > >
> > > From: Xiaoli Feng <xifeng@redhat.com>
> > >
> > > For directIO, cannot generate pmd pagefault by pread|pwrite|read|write
> > > if do not map fd to memory. In dax-pmd.c, case 1 and case 4 each only
> > > generate once pmd pagefault. So change the all counts from 10 to 8.
> >
> > What kernel are you seeing this failure on? It's passing for me on v5.6-rc.
>
> I test on v4.18. I will test on v5.6.
>

The tests are not backwards compatible with older kernels. If the
current tests fail on an older kernel it means that older kernel is
missing a backport of features / fixes from upstream. In this case the
test was written as a regression test for kernel commit 6370740e5f8e
("fs/dax: Fix pmd vs pte conflict detection"). v4.18 precedes the
Xarray conversion of the filesystem-dax interface which incurred other
pmd behavior fixes so I'm not sure it will ever map correctly to that
baseline.

At a minimum I would say you would need to carry this change in the
distro package for ndctl that corresponds with that v4.18 kernel.
Xiaoli Feng March 20, 2020, 5:16 a.m. UTC | #4
Hi,

----- Original Message -----
> From: "Dan Williams" <dan.j.williams@intel.com>
> To: "Xiaoli Feng" <xifeng@redhat.com>
> Cc: "linux-nvdimm" <linux-nvdimm@lists.01.org>
> Sent: Friday, March 20, 2020 11:37:07 AM
> Subject: Re: [PATCH v1] test/dax.sh: correct the pmd pagefault counts generated by dax-pmd
> 
> On Thu, Mar 19, 2020 at 8:19 PM Xiaoli Feng <xifeng@redhat.com> wrote:
> >
> > Hi,
> >
> > ----- Original Message -----
> > > From: "Dan Williams" <dan.j.williams@intel.com>
> > > To: "XiaoLi Feng" <xifeng@redhat.com>
> > > Cc: "linux-nvdimm" <linux-nvdimm@lists.01.org>
> > > Sent: Friday, March 20, 2020 10:36:05 AM
> > > Subject: Re: [PATCH v1] test/dax.sh: correct the pmd pagefault counts
> > > generated by dax-pmd
> > >
> > > On Thu, Mar 19, 2020 at 7:13 PM XiaoLi Feng <xifeng@redhat.com> wrote:
> > > >
> > > > From: Xiaoli Feng <xifeng@redhat.com>
> > > >
> > > > For directIO, cannot generate pmd pagefault by pread|pwrite|read|write
> > > > if do not map fd to memory. In dax-pmd.c, case 1 and case 4 each only
> > > > generate once pmd pagefault. So change the all counts from 10 to 8.
> > >
> > > What kernel are you seeing this failure on? It's passing for me on
> > > v5.6-rc.
> >
> > I test on v4.18. I will test on v5.6.
> >
> 
> The tests are not backwards compatible with older kernels. If the
> current tests fail on an older kernel it means that older kernel is
> missing a backport of features / fixes from upstream. In this case the
> test was written as a regression test for kernel commit 6370740e5f8e
> ("fs/dax: Fix pmd vs pte conflict detection"). v4.18 precedes the
> Xarray conversion of the filesystem-dax interface which incurred other
> pmd behavior fixes so I'm not sure it will ever map correctly to that
> baseline.
> 
> At a minimum I would say you would need to carry this change in the
> distro package for ndctl that corresponds with that v4.18 kernel.

My test kernel include the patch fs/dax: Fix pmd vs pte conflict detection.
I am checking the changes from v4.18. Thanks for the info and suggestion.

> 
>

Patch
diff mbox series

diff --git a/test/dax.sh b/test/dax.sh
index 3933107..bd08641 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -40,13 +40,13 @@  run_test() {
 	# Fragile hack to double check the kernel services this test
 	# with successful pmd faults. If dax-pmd.c ever changes the
 	# number of times the dax_pmd_fault_done trace point fires the
-	# hack needs to be updated from 10 expected firings and the
+	# hack needs to be updated from 8 expected firings and the
 	# result of success (NOPAGE).
 	count=0
 	rc=1
 	while read -r p; do
 		[[ $p ]] || continue
-		if [ "$count" -lt 10 ]; then
+		if [ "$count" -lt 8 ]; then
 			if [ "$p" != "0x100" ] && [ "$p" != "NOPAGE" ]; then
 				cleanup "$1"
 			fi
@@ -54,7 +54,7 @@  run_test() {
 		count=$((count + 1))
 	done < <(trace-cmd report | awk '{ print $21 }')
 
-	if [ $count -lt 10 ]; then
+	if [ $count -lt 8 ]; then
 		cleanup "$1"
 	fi
 }