Skip to contentSkip to conversation

ndctl: test/daxctl-devices.sh: increase the namespace size

PATCH In review Jeff Moyer 3 participants 4 messages Nov 7, 2023 – Nov 27, 2023 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Jeff Moyer

author
#0 lore raw

PATCH 1/1 ndctl: test/daxctl-devices.sh: increase the namespace size

Memory hotplug requires the namespace to be aligned to a boundary that depends on several factors. Upstream kernel commit fe124c95df9e ("x86/mm: use max memory block size on bare metal") increased the typical size/alignment to 2GiB from 256MiB. As a result, this test no longer passes on our bare metal test systems.

This patch fixes the test failure by bumping the namespace size to 4GiB, which leaves room for aligning the start and end to 2GiB.

test/daxctl-devices.sh +4 -1
index 56c9691..dfce74b 100755
@@ -44,7 +44,10 @@ setup_dev()
 	test -n "$testdev"
 
 	"$NDCTL" destroy-namespace -f -b "$testbus" "$testdev"
-	testdev=$("$NDCTL" create-namespace -b "$testbus" -m devdax -fe "$testdev" -s 256M | \
+	# x86_64 memory hotplug can require up to a 2GiB-aligned chunk
+	# of memory.  Create a 4GiB namespace, so that we will still have
+	# enough room left after aligning the start and end.
+	testdev=$("$NDCTL" create-namespace -b "$testbus" -m devdax -fe "$testdev" -s 4G | \
 		jq -er '.dev')
 	test -n "$testdev"
 }
author
#1 lore raw

I forgot to mention that this should address the following github issue:

https://github.com/pmem/ndctl/issues/243

-Jeff

Quoted 27 lines · Jeff Moyer

Memory hotplug requires the namespace to be aligned to a boundary that depends on several factors. Upstream kernel commit fe124c95df9e ("x86/mm: use max memory block size on bare metal") increased the typical size/alignment to 2GiB from 256MiB. As a result, this test no longer passes on our bare metal test systems.

This patch fixes the test failure by bumping the namespace size to 4GiB, which leaves room for aligning the start and end to 2GiB.

test/daxctl-devices.sh +4 -1
index 56c9691..dfce74b 100755
@@ -44,7 +44,10 @@ setup_dev()
 	test -n "$testdev"
 
 	"$NDCTL" destroy-namespace -f -b "$testbus" "$testdev"
-	testdev=$("$NDCTL" create-namespace -b "$testbus" -m devdax -fe "$testdev" -s 256M | \
+	# x86_64 memory hotplug can require up to a 2GiB-aligned chunk
+	# of memory.  Create a 4GiB namespace, so that we will still have
+	# enough room left after aligning the start and end.
+	testdev=$("$NDCTL" create-namespace -b "$testbus" -m devdax -fe "$testdev" -s 4G | \
 		jq -er '.dev')
 	test -n "$testdev"
 }
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Jeff Moyer
Quoted 10 lines · Jeff Moyer

Memory hotplug requires the namespace to be aligned to a boundary that depends on several factors. Upstream kernel commit fe124c95df9e ("x86/mm: use max memory block size on bare metal") increased the typical size/alignment to 2GiB from 256MiB. As a result, this test no longer passes on our bare metal test systems.

This patch fixes the test failure by bumping the namespace size to 4GiB, which leaves room for aligning the start and end to 2GiB.

Quoted 19 lines
test/daxctl-devices.sh +4 -1
index 56c9691..dfce74b 100755
@@ -44,7 +44,10 @@ setup_dev()
 	test -n "$testdev"
 
 	"$NDCTL" destroy-namespace -f -b "$testbus" "$testdev"
-	testdev=$("$NDCTL" create-namespace -b "$testbus" -m devdax -fe "$testdev" -s 256M | \
+	# x86_64 memory hotplug can require up to a 2GiB-aligned chunk
+	# of memory.  Create a 4GiB namespace, so that we will still have
+	# enough room left after aligning the start and end.
+	testdev=$("$NDCTL" create-namespace -b "$testbus" -m devdax -fe "$testdev" -s 4G | \
 		jq -er '.dev')
 	test -n "$testdev"
 }
Tested-by on v1 1/1
#3 lore raw
In reply to Jeff Moyer
Quoted 11 lines · Jeff Moyer

Memory hotplug requires the namespace to be aligned to a boundary that depends on several factors. Upstream kernel commit fe124c95df9e ("x86/mm: use max memory block size on bare metal") increased the typical size/alignment to 2GiB from 256MiB. As a result, this test no longer passes on our bare metal test systems.

This patch fixes the test failure by bumping the namespace size to 4GiB, which leaves room for aligning the start and end to 2GiB.

Thanks Jeff

Quoted 19 lines
test/daxctl-devices.sh +4 -1
index 56c9691..dfce74b 100755
@@ -44,7 +44,10 @@ setup_dev()
        test -n "$testdev"
 
        "$NDCTL" destroy-namespace -f -b "$testbus" "$testdev"
-       testdev=$("$NDCTL" create-namespace -b "$testbus" -m devdax -fe "$testdev" -s 256M | \
+       # x86_64 memory hotplug can require up to a 2GiB-aligned chunk
+       # of memory.  Create a 4GiB namespace, so that we will still have
+       # enough room left after aligning the start and end.
+       testdev=$("$NDCTL" create-namespace -b "$testbus" -m devdax -fe "$testdev" -s 4G | \
                jq -er '.dev')
        test -n "$testdev"
 }
Signature · 2 lines
Best Regards,
  Yi Zhang