linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
* [ndctl PATCH 0/4] test/dax.sh: Add huge page fault validation
@ 2019-10-19 16:39 Dan Williams
  2019-10-19 16:39 ` [ndctl PATCH 1/4] test/dax.sh: Fix failure reporting / handling Dan Williams
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Dan Williams @ 2019-10-19 16:39 UTC (permalink / raw)
  To: linux-nvdimm

v5.3 regressed huge page faulting and the ndctl unit test that tries to
generate huge page faults did not report it.

- Use trace-cmd to validate fault results
- Workaround XFS issues with fallocate > agsize
- Split the test to get distinct ext4 and xfs results
- Other misc fixups.

---

Dan Williams (4):
      test/dax.sh: Fix failure reporting / handling
      test/dax.sh: Fix xfs 2M alignment
      test/dax.sh: Validate huge page mappings
      test/dax.sh: Split into ext4 and xfs tests


 test/Makefile.am |    3 +
 test/dax-ext4.sh |    1 
 test/dax-pmd.c   |    3 +
 test/dax-xfs.sh  |    1 
 test/dax.sh      |  127 ++++++++++++++++++++++++++++++++++--------------------
 5 files changed, 87 insertions(+), 48 deletions(-)
 create mode 120000 test/dax-ext4.sh
 create mode 120000 test/dax-xfs.sh
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [ndctl PATCH 1/4] test/dax.sh: Fix failure reporting / handling
  2019-10-19 16:39 [ndctl PATCH 0/4] test/dax.sh: Add huge page fault validation Dan Williams
@ 2019-10-19 16:39 ` Dan Williams
  2019-10-19 16:39 ` [ndctl PATCH 2/4] test/dax.sh: Fix xfs 2M alignment Dan Williams
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Dan Williams @ 2019-10-19 16:39 UTC (permalink / raw)
  To: linux-nvdimm

Instrument the cleanup() function rather than the err() function to
handle run_test() failures. This ensures umount runs and reports the
line number of the test rather than the line number internal to
run_test().

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/dax.sh |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/test/dax.sh b/test/dax.sh
index 3bb44ac0a26c..b8eb4ce54e10 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -33,7 +33,7 @@ run_test() {
 	if ! ./dax-pmd $MNT/$FILE; then
 		rc=$?
 		if [ $rc -ne 77 -a $rc -ne 0 ]; then
-			err
+			cleanup $1
 		fi
 	fi
 }
@@ -50,7 +50,7 @@ rc=1
 mkfs.ext4 -b 4096 /dev/$blockdev
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
-run_test
+run_test $LINENO
 umount $MNT
 
 # convert pmem to put the memmap on the device
@@ -62,7 +62,7 @@ eval $(json2var <<< "$json")
 mkfs.ext4 -b 4096 /dev/$blockdev
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
-run_test
+run_test $LINENO
 umount $MNT
 
 json=$($NDCTL create-namespace -m raw -f -e $dev)
@@ -72,7 +72,7 @@ eval $(json2var <<< "$json")
 mkfs.xfs -f /dev/$blockdev -m reflink=0
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
-run_test
+run_test $LINENO
 umount $MNT
 
 # convert pmem to put the memmap on the device
@@ -83,7 +83,7 @@ eval $(json2var <<< "$json")
 mkfs.xfs -f /dev/$blockdev -m reflink=0
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
-run_test
+run_test $LINENO
 umount $MNT
 
 # revert namespace to raw mode
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [ndctl PATCH 2/4] test/dax.sh: Fix xfs 2M alignment
  2019-10-19 16:39 [ndctl PATCH 0/4] test/dax.sh: Add huge page fault validation Dan Williams
  2019-10-19 16:39 ` [ndctl PATCH 1/4] test/dax.sh: Fix failure reporting / handling Dan Williams
@ 2019-10-19 16:39 ` Dan Williams
  2019-10-19 16:39 ` [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings Dan Williams
  2019-10-19 16:39 ` [ndctl PATCH 4/4] test/dax.sh: Split into ext4 and xfs tests Dan Williams
  3 siblings, 0 replies; 9+ messages in thread
From: Dan Williams @ 2019-10-19 16:39 UTC (permalink / raw)
  To: linux-nvdimm

Update the mkfs parameters for the xfs test to ensure 2M aligned
extents, and validate proper alignment in dax-pmd.c.

Link: https://lkml.kernel.org/r/CAPcyv4g2U6YYj6BO_nMgUYPfE2d04pZvKP0JQwNAMy9HZ3UNvg@mail.gmail.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/dax-pmd.c |    3 ++-
 test/dax.sh    |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/test/dax-pmd.c b/test/dax-pmd.c
index 8ed3e9b764f9..0c95b20707c2 100644
--- a/test/dax-pmd.c
+++ b/test/dax-pmd.c
@@ -234,10 +234,11 @@ static int test_pmd(struct ndctl_test *test, int fd)
 
 	for (i = 0; i < map->fm_mapped_extents; i++) {
 		ext = &map->fm_extents[i];
+		p_align = ALIGN(ext->fe_physical, HPAGE_SIZE) - ext->fe_physical;
 		fprintf(stderr, "[%ld]: l: %llx p: %llx len: %llx flags: %x\n",
 				i, ext->fe_logical, ext->fe_physical,
 				ext->fe_length, ext->fe_flags);
-		if (ext->fe_length > 2 * HPAGE_SIZE) {
+		if (ext->fe_length > 2 * HPAGE_SIZE && p_align == 0) {
 			fprintf(stderr, "found potential huge extent\n");
 			break;
 		}
diff --git a/test/dax.sh b/test/dax.sh
index b8eb4ce54e10..59d5eafadae8 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -69,7 +69,7 @@ json=$($NDCTL create-namespace -m raw -f -e $dev)
 eval $(json2var <<< "$json")
 [ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
 
-mkfs.xfs -f /dev/$blockdev -m reflink=0
+mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
 run_test $LINENO
@@ -80,7 +80,7 @@ json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
 eval $(json2var <<< "$json")
 [ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
 
-mkfs.xfs -f /dev/$blockdev -m reflink=0
+mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
 run_test $LINENO
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings
  2019-10-19 16:39 [ndctl PATCH 0/4] test/dax.sh: Add huge page fault validation Dan Williams
  2019-10-19 16:39 ` [ndctl PATCH 1/4] test/dax.sh: Fix failure reporting / handling Dan Williams
  2019-10-19 16:39 ` [ndctl PATCH 2/4] test/dax.sh: Fix xfs 2M alignment Dan Williams
@ 2019-10-19 16:39 ` Dan Williams
  2019-10-23 19:33   ` Verma, Vishal L
  2019-10-19 16:39 ` [ndctl PATCH 4/4] test/dax.sh: Split into ext4 and xfs tests Dan Williams
  3 siblings, 1 reply; 9+ messages in thread
From: Dan Williams @ 2019-10-19 16:39 UTC (permalink / raw)
  To: linux-nvdimm

Using trace-cmd to validate the expectations of the huge page faults
generated by the dax-pmd.c test.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/dax.sh |   24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/test/dax.sh b/test/dax.sh
index 59d5eafadae8..e5945fc3e335 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -30,12 +30,32 @@ cleanup() {
 
 run_test() {
 	rc=0
-	if ! ./dax-pmd $MNT/$FILE; then
+	if ! trace-cmd record -e fs_dax:dax_pmd_fault_done ./dax-pmd $MNT/$FILE; then
 		rc=$?
 		if [ $rc -ne 77 -a $rc -ne 0 ]; then
 			cleanup $1
 		fi
 	fi
+
+	# 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
+	# result of success (NOPAGE).
+	count=0
+	rc=1
+	for p in $(trace-cmd report | awk '{ print $21 }')
+	do
+		if [ $count -lt 10 ]; then
+			if [ $p != "0x100" -a $p != "NOPAGE" ]; then
+				cleanup $1
+			fi
+		fi
+		count=$((count + 1))
+	done
+	if [ $count -lt 10 ]; then
+		cleanup $1
+	fi
 }
 
 set -e
@@ -91,4 +111,4 @@ json=$($NDCTL create-namespace -m raw -f -e $dev)
 eval $(json2var <<< "$json")
 [ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
 
-exit $rc
+exit 0
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [ndctl PATCH 4/4] test/dax.sh: Split into ext4 and xfs tests
  2019-10-19 16:39 [ndctl PATCH 0/4] test/dax.sh: Add huge page fault validation Dan Williams
                   ` (2 preceding siblings ...)
  2019-10-19 16:39 ` [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings Dan Williams
@ 2019-10-19 16:39 ` Dan Williams
  3 siblings, 0 replies; 9+ messages in thread
From: Dan Williams @ 2019-10-19 16:39 UTC (permalink / raw)
  To: linux-nvdimm

Given the test can fail based on the fs make it a passed in parameter
and split the tests.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/Makefile.am |    3 +-
 test/dax-ext4.sh |    1 +
 test/dax-xfs.sh  |    1 +
 test/dax.sh      |  101 +++++++++++++++++++++++++++++++-----------------------
 4 files changed, 62 insertions(+), 44 deletions(-)
 create mode 120000 test/dax-ext4.sh
 create mode 120000 test/dax-xfs.sh

diff --git a/test/Makefile.am b/test/Makefile.am
index ffbe8a3d7e34..3612e58d46b6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -48,7 +48,8 @@ TESTS +=\
 	pmem-ns \
 	sub-section.sh \
 	dax-dev \
-	dax.sh \
+	dax-ext4.sh \
+	dax-xfs.sh \
 	device-dax \
 	device-dax-fio.sh \
 	daxctl-devices.sh \
diff --git a/test/dax-ext4.sh b/test/dax-ext4.sh
new file mode 120000
index 000000000000..da4ec437a92a
--- /dev/null
+++ b/test/dax-ext4.sh
@@ -0,0 +1 @@
+dax.sh
\ No newline at end of file
diff --git a/test/dax-xfs.sh b/test/dax-xfs.sh
new file mode 120000
index 000000000000..da4ec437a92a
--- /dev/null
+++ b/test/dax-xfs.sh
@@ -0,0 +1 @@
+dax.sh
\ No newline at end of file
diff --git a/test/dax.sh b/test/dax.sh
index e5945fc3e335..ed1738d58bb7 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -58,6 +58,56 @@ run_test() {
 	fi
 }
 
+run_ext4() {
+	mkfs.ext4 -b 4096 /dev/$blockdev
+	mount /dev/$blockdev $MNT -o dax
+	fallocate -l 1GiB $MNT/$FILE
+	run_test $LINENO
+	umount $MNT
+
+	# convert pmem to put the memmap on the device
+	json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
+	eval $(json2var <<< "$json")
+	[ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
+	#note the blockdev returned from ndctl create-namespace lacks the /dev prefix
+
+	mkfs.ext4 -b 4096 /dev/$blockdev
+	mount /dev/$blockdev $MNT -o dax
+	fallocate -l 1GiB $MNT/$FILE
+	run_test $LINENO
+	umount $MNT
+	json=$($NDCTL create-namespace -m raw -f -e $dev)
+
+	eval $(json2var <<< "$json")
+	[ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
+	true
+}
+
+run_xfs() {
+	mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
+	mount /dev/$blockdev $MNT -o dax
+	fallocate -l 1GiB $MNT/$FILE
+	run_test $LINENO
+	umount $MNT
+
+	# convert pmem to put the memmap on the device
+	json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
+	eval $(json2var <<< "$json")
+	[ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
+	mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
+
+	mount /dev/$blockdev $MNT -o dax
+	fallocate -l 1GiB $MNT/$FILE
+	run_test $LINENO
+	umount $MNT
+	# revert namespace to raw mode
+
+	json=$($NDCTL create-namespace -m raw -f -e $dev)
+	eval $(json2var <<< "$json")
+	[ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
+	true
+}
+
 set -e
 mkdir -p $MNT
 trap 'err $LINENO cleanup' ERR
@@ -67,48 +117,13 @@ json=$($NDCTL list -N -n $dev)
 eval $(json2var <<< "$json")
 rc=1
 
-mkfs.ext4 -b 4096 /dev/$blockdev
-mount /dev/$blockdev $MNT -o dax
-fallocate -l 1GiB $MNT/$FILE
-run_test $LINENO
-umount $MNT
-
-# convert pmem to put the memmap on the device
-json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
-eval $(json2var <<< "$json")
-[ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
-
-#note the blockdev returned from ndctl create-namespace lacks the /dev prefix
-mkfs.ext4 -b 4096 /dev/$blockdev
-mount /dev/$blockdev $MNT -o dax
-fallocate -l 1GiB $MNT/$FILE
-run_test $LINENO
-umount $MNT
-
-json=$($NDCTL create-namespace -m raw -f -e $dev)
-eval $(json2var <<< "$json")
-[ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
-
-mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
-mount /dev/$blockdev $MNT -o dax
-fallocate -l 1GiB $MNT/$FILE
-run_test $LINENO
-umount $MNT
-
-# convert pmem to put the memmap on the device
-json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
-eval $(json2var <<< "$json")
-[ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
-
-mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
-mount /dev/$blockdev $MNT -o dax
-fallocate -l 1GiB $MNT/$FILE
-run_test $LINENO
-umount $MNT
-
-# revert namespace to raw mode
-json=$($NDCTL create-namespace -m raw -f -e $dev)
-eval $(json2var <<< "$json")
-[ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
+if [ $(basename $0) = "dax-ext4.sh" ]; then
+	run_ext4
+elif [ $(basename $0) = "dax-xfs.sh" ]; then
+	run_xfs
+else
+	run_ext4
+	run_xfs
+fi
 
 exit 0
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings
  2019-10-19 16:39 ` [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings Dan Williams
@ 2019-10-23 19:33   ` Verma, Vishal L
  2019-10-23 19:41     ` Verma, Vishal L
  0 siblings, 1 reply; 9+ messages in thread
From: Verma, Vishal L @ 2019-10-23 19:33 UTC (permalink / raw)
  To: Williams, Dan J, linux-nvdimm


On Sat, 2019-10-19 at 09:39 -0700, Dan Williams wrote:
> Using trace-cmd to validate the expectations of the huge page faults
> generated by the dax-pmd.c test.
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  test/dax.sh |   24 ++++++++++++++++++++++--
>  1 file changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/test/dax.sh b/test/dax.sh
> index 59d5eafadae8..e5945fc3e335 100755
> --- a/test/dax.sh
> +++ b/test/dax.sh
> @@ -30,12 +30,32 @@ cleanup() {
>  
>  run_test() {
>  	rc=0
> -	if ! ./dax-pmd $MNT/$FILE; then
> +	if ! trace-cmd record -e fs_dax:dax_pmd_fault_done ./dax-pmd $MNT/$FILE; then
>  		rc=$?
>  		if [ $rc -ne 77 -a $rc -ne 0 ]; then
>  			cleanup $1
>  		fi
>  	fi
> +
> +	# 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
> +	# result of success (NOPAGE).
> +	count=0
> +	rc=1
> +	for p in $(trace-cmd report | awk '{ print $21 }')
> +	do
> +		if [ $count -lt 10 ]; then
> +			if [ $p != "0x100" -a $p != "NOPAGE" ]; then
> +				cleanup $1
> +			fi
> +		fi
> +		count=$((count + 1))
> +	done

We shouldn't read lines with 'for' - if the command in $() happens to
spit out any glob metacharacters, we can get unexpected iterations.

It should instead be:

   while read -r p; do

   ...

   done < <(trace-cmd report | awk '{ print $21 }')


> +	if [ $count -lt 10 ]; then

within [ ], any $variables should be quoted. Generally true for just
about all variables. If [[ ]] is used (bash-specific), then the quoting
may be omitted, but since it is a math comparison, the easiest might be:

   if ((count < 10)); then
   ...
   fi

> +		cleanup $1
> +	fi
>  }
>  
>  set -e
> @@ -91,4 +111,4 @@ json=$($NDCTL create-namespace -m raw -f -e $dev)
>  eval $(json2var <<< "$json")
>  [ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1

same comment about quoting "$mode". If 'mode' happens to be empty for
soem reason, we want to fail with the error message - instead the above
will fail with a syntax error.

>  
> -exit $rc
> +exit 0
> _______________________________________________
> Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
> To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings
  2019-10-23 19:33   ` Verma, Vishal L
@ 2019-10-23 19:41     ` Verma, Vishal L
  2019-10-25 22:44       ` Verma, Vishal L
  0 siblings, 1 reply; 9+ messages in thread
From: Verma, Vishal L @ 2019-10-23 19:41 UTC (permalink / raw)
  To: Williams, Dan J, linux-nvdimm

On Wed, 2019-10-23 at 19:33 +0000, Verma, Vishal L wrote:
> 
> > @@ -91,4 +111,4 @@ json=$($NDCTL create-namespace -m raw -f -e $dev)
> >  eval $(json2var <<< "$json")
> >  [ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
> 
> same comment about quoting "$mode". If 'mode' happens to be empty for
> soem reason, we want to fail with the error message - instead the above
> will fail with a syntax error.

Sorry ignore this - that was a context line..

_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings
  2019-10-23 19:41     ` Verma, Vishal L
@ 2019-10-25 22:44       ` Verma, Vishal L
  2019-10-25 23:26         ` Dan Williams
  0 siblings, 1 reply; 9+ messages in thread
From: Verma, Vishal L @ 2019-10-25 22:44 UTC (permalink / raw)
  To: Williams, Dan J, linux-nvdimm

> On Wed, 2019-10-23 at 19:33 +0000, Verma, Vishal L wrote:
> > > @@ -91,4 +111,4 @@ json=$($NDCTL create-namespace -m raw -f -e $dev)
> > >  eval $(json2var <<< "$json")
> > >  [ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
> > 
> > same comment about quoting "$mode". If 'mode' happens to be empty for
> > soem reason, we want to fail with the error message - instead the above
> > will fail with a syntax error.
> 
> Sorry ignore this - that was a context line..
> 

Hey Dan,

I've applied patches 1-3, with the following fixup to patch 3.
Patch 4 didn't apply cleanly, if you can resend that I'll queue it up too.

--8<--

From 9d6c43d5240ddb18b5540b3064f2f90c25dcf574 Mon Sep 17 00:00:00 2001
From: Vishal Verma <vishal.l.verma@intel.com>
Date: Fri, 25 Oct 2019 16:41:22 -0600
Subject: [ndctl PATCH] fixup! test/dax.sh: Validate huge page mappings

---
 test/dax.sh | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/test/dax.sh b/test/dax.sh
index 157b398..45c2027 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -32,8 +32,8 @@ run_test() {
 	rc=0
 	if ! trace-cmd record -e fs_dax:dax_pmd_fault_done ./dax-pmd $MNT/$FILE; then
 		rc=$?
-		if [ $rc -ne 77 -a $rc -ne 0 ]; then
-			cleanup $1
+		if [ "$rc" -ne 77 ] && [ "$rc" -ne 0 ]; then
+			cleanup "$1"
 		fi
 	fi
 
@@ -44,17 +44,18 @@ run_test() {
 	# result of success (NOPAGE).
 	count=0
 	rc=1
-	for p in $(trace-cmd report | awk '{ print $21 }')
-	do
-		if [ $count -lt 10 ]; then
-			if [ $p != "0x100" -a $p != "NOPAGE" ]; then
-				cleanup $1
+	while read -r p; do
+		[[ $p ]] || continue
+		if [ "$count" -lt 10 ]; then
+			if [ "$p" != "0x100" ] && [ "$p" != "NOPAGE" ]; then
+				cleanup "$1"
 			fi
 		fi
 		count=$((count + 1))
-	done
+	done < <(trace-cmd report | awk '{ print $21 }')
+
 	if [ $count -lt 10 ]; then
-		cleanup $1
+		cleanup "$1"
 	fi
 }
 
-- 
2.20.1


_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings
  2019-10-25 22:44       ` Verma, Vishal L
@ 2019-10-25 23:26         ` Dan Williams
  0 siblings, 0 replies; 9+ messages in thread
From: Dan Williams @ 2019-10-25 23:26 UTC (permalink / raw)
  To: Verma, Vishal L; +Cc: linux-nvdimm

On Fri, Oct 25, 2019 at 3:44 PM Verma, Vishal L
<vishal.l.verma@intel.com> wrote:
>
> > On Wed, 2019-10-23 at 19:33 +0000, Verma, Vishal L wrote:
> > > > @@ -91,4 +111,4 @@ json=$($NDCTL create-namespace -m raw -f -e $dev)
> > > >  eval $(json2var <<< "$json")
> > > >  [ $mode != "fsdax" ] && echo "fail: $LINENO" &&  exit 1
> > >
> > > same comment about quoting "$mode". If 'mode' happens to be empty for
> > > soem reason, we want to fail with the error message - instead the above
> > > will fail with a syntax error.
> >
> > Sorry ignore this - that was a context line..
> >
>
> Hey Dan,
>
> I've applied patches 1-3, with the following fixup to patch 3.
> Patch 4 didn't apply cleanly, if you can resend that I'll queue it up too.

Will do, thanks for the fixups!
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-10-25 23:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-19 16:39 [ndctl PATCH 0/4] test/dax.sh: Add huge page fault validation Dan Williams
2019-10-19 16:39 ` [ndctl PATCH 1/4] test/dax.sh: Fix failure reporting / handling Dan Williams
2019-10-19 16:39 ` [ndctl PATCH 2/4] test/dax.sh: Fix xfs 2M alignment Dan Williams
2019-10-19 16:39 ` [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings Dan Williams
2019-10-23 19:33   ` Verma, Vishal L
2019-10-23 19:41     ` Verma, Vishal L
2019-10-25 22:44       ` Verma, Vishal L
2019-10-25 23:26         ` Dan Williams
2019-10-19 16:39 ` [ndctl PATCH 4/4] test/dax.sh: Split into ext4 and xfs tests Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).