* [ndctl PATCH 0/2] Use CXL regions in daxctl-create unit test
@ 2024-08-28 3:14 alison.schofield
2024-08-28 3:14 ` [ndctl PATCH 1/2] test/daxctl-create.sh: use bash math syntax to find available size alison.schofield
2024-08-28 3:14 ` [ndctl PATCH 2/2] test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem alison.schofield
0 siblings, 2 replies; 7+ messages in thread
From: alison.schofield @ 2024-08-28 3:14 UTC (permalink / raw)
To: nvdimm; +Cc: Alison Schofield, linux-cxl
From: Alison Schofield <alison.schofield@intel.com>
efi_fake_mem support was removed from the kernel in v6.11 making
this unit test SKIP, unable to find the hmem regions that relied
upon the fake devices.
Pivoting to use the already available CXL regions seems like a
good fit. The setup changes but the same DAX test functionality
remains unchanged.
Please take a look.
Alison Schofield (2):
test/daxctl-create.sh: use bash math syntax to find available size
test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem
test/daxctl-create.sh | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
--
2.37.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ndctl PATCH 1/2] test/daxctl-create.sh: use bash math syntax to find available size
2024-08-28 3:14 [ndctl PATCH 0/2] Use CXL regions in daxctl-create unit test alison.schofield
@ 2024-08-28 3:14 ` alison.schofield
2024-09-03 21:28 ` Verma, Vishal L
2024-08-28 3:14 ` [ndctl PATCH 2/2] test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem alison.schofield
1 sibling, 1 reply; 7+ messages in thread
From: alison.schofield @ 2024-08-28 3:14 UTC (permalink / raw)
To: nvdimm; +Cc: Alison Schofield, linux-cxl
From: Alison Schofield <alison.schofield@intel.com>
The check for 1GB of available space in a DAX region always returned
true due to being wrapped inside a [[ ... ]] test, even when space
wasn't available. That caused set size to fail.
Update to use bash arithmetic evaluation instead.
This issue likely went unnoticed because users allocated >= 1GB of
efi_fake_mem. This fix is part of the transition to use CXL regions
in this test as efi_fake_mem support is being removed from the kernel.
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
---
test/daxctl-create.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/daxctl-create.sh b/test/daxctl-create.sh
index c093cb9e306a..d968e7bedd82 100755
--- a/test/daxctl-create.sh
+++ b/test/daxctl-create.sh
@@ -363,7 +363,7 @@ daxctl_test6()
# Use 2M by default or 1G if supported
align=2097152
- if [[ $((available >= 1073741824 )) ]]; then
+ if (( available >= 1073741824 )); then
align=1073741824
size=$align
fi
--
2.37.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [ndctl PATCH 2/2] test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem
2024-08-28 3:14 [ndctl PATCH 0/2] Use CXL regions in daxctl-create unit test alison.schofield
2024-08-28 3:14 ` [ndctl PATCH 1/2] test/daxctl-create.sh: use bash math syntax to find available size alison.schofield
@ 2024-08-28 3:14 ` alison.schofield
2024-08-29 16:55 ` Dan Williams
2024-09-04 0:34 ` Verma, Vishal L
1 sibling, 2 replies; 7+ messages in thread
From: alison.schofield @ 2024-08-28 3:14 UTC (permalink / raw)
To: nvdimm; +Cc: Alison Schofield, linux-cxl
From: Alison Schofield <alison.schofield@intel.com>
This test tries to use DAX regions created from efi_fake_mem devices.
A recent kernel change removed efi_fake_mem support causing this test
to SKIP because no DAX regions can be found.
Alas, a new source of DAX regions is available: CXL. Use that now.
Other than selecting a different region provider, the functionality
of the test remains the same.
Signed-off-by: Alison Schofield <alison.schofield@intel.com>
---
test/daxctl-create.sh | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/test/daxctl-create.sh b/test/daxctl-create.sh
index d968e7bedd82..1ef70f2ff186 100755
--- a/test/daxctl-create.sh
+++ b/test/daxctl-create.sh
@@ -7,6 +7,9 @@ rc=77
trap 'cleanup $LINENO' ERR
+modprobe -r cxl_test
+modprobe cxl_test
+
cleanup()
{
printf "Error at line %d\n" "$1"
@@ -18,18 +21,10 @@ find_testdev()
{
local rc=77
- # The hmem driver is needed to change the device mode, only
- # kernels >= v5.6 might have it available. Skip if not.
- if ! modinfo dax_hmem; then
- # check if dax_hmem is builtin
- if [ ! -d "/sys/module/device_hmem" ]; then
- printf "Unable to find hmem module\n"
- exit $rc
- fi
- fi
+ # find a victim region provided by cxl_test
+ bus="$("$CXL" list -b "$CXL_TEST_BUS" | jq -r '.[] | .bus')"
+ region_id="$("$DAXCTL" list -R | jq -r ".[] | select(.path | contains(\"$bus\")) | .id")"
- # find a victim region provided by dax_hmem
- region_id="$("$DAXCTL" list -R | jq -r '.[] | select(.path | contains("hmem")) | .id')"
if [[ ! "$region_id" ]]; then
printf "Unable to find a victim region\n"
exit "$rc"
@@ -413,4 +408,5 @@ daxctl_test5
daxctl_test6
daxctl_test7
reset_dev
+modprobe -r cxl_test
exit 0
--
2.37.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [ndctl PATCH 2/2] test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem
2024-08-28 3:14 ` [ndctl PATCH 2/2] test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem alison.schofield
@ 2024-08-29 16:55 ` Dan Williams
2024-08-29 20:50 ` Alison Schofield
2024-09-04 0:34 ` Verma, Vishal L
1 sibling, 1 reply; 7+ messages in thread
From: Dan Williams @ 2024-08-29 16:55 UTC (permalink / raw)
To: alison.schofield, nvdimm; +Cc: Alison Schofield, linux-cxl
alison.schofield@ wrote:
> From: Alison Schofield <alison.schofield@intel.com>
>
> This test tries to use DAX regions created from efi_fake_mem devices.
> A recent kernel change removed efi_fake_mem support causing this test
> to SKIP because no DAX regions can be found.
>
> Alas, a new source of DAX regions is available: CXL. Use that now.
> Other than selecting a different region provider, the functionality
> of the test remains the same.
CXL looks like a useful replacement.
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> ---
> test/daxctl-create.sh | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/test/daxctl-create.sh b/test/daxctl-create.sh
> index d968e7bedd82..1ef70f2ff186 100755
> --- a/test/daxctl-create.sh
> +++ b/test/daxctl-create.sh
> @@ -7,6 +7,9 @@ rc=77
>
> trap 'cleanup $LINENO' ERR
>
> +modprobe -r cxl_test
> +modprobe cxl_test
> +
> cleanup()
> {
> printf "Error at line %d\n" "$1"
> @@ -18,18 +21,10 @@ find_testdev()
> {
> local rc=77
>
> - # The hmem driver is needed to change the device mode, only
> - # kernels >= v5.6 might have it available. Skip if not.
> - if ! modinfo dax_hmem; then
> - # check if dax_hmem is builtin
> - if [ ! -d "/sys/module/device_hmem" ]; then
> - printf "Unable to find hmem module\n"
> - exit $rc
> - fi
> - fi
> + # find a victim region provided by cxl_test
> + bus="$("$CXL" list -b "$CXL_TEST_BUS" | jq -r '.[] | .bus')"
> + region_id="$("$DAXCTL" list -R | jq -r ".[] | select(.path | contains(\"$bus\")) | .id")"
Might as well skip using cxl-list and instead use the known
platform device hosting the cxl_test CXL topology: "cxl_acpi.0"
region_id="$("$DAXCTL" list -R | jq -r ".[] | select(.path | contains(\"cxl_acpi.0\")) | .id")"
...other than that you can add:
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ndctl PATCH 2/2] test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem
2024-08-29 16:55 ` Dan Williams
@ 2024-08-29 20:50 ` Alison Schofield
0 siblings, 0 replies; 7+ messages in thread
From: Alison Schofield @ 2024-08-29 20:50 UTC (permalink / raw)
To: Dan Williams; +Cc: nvdimm, linux-cxl
On Thu, Aug 29, 2024 at 09:55:59AM -0700, Dan Williams wrote:
> alison.schofield@ wrote:
> > From: Alison Schofield <alison.schofield@intel.com>
> >
> > This test tries to use DAX regions created from efi_fake_mem devices.
> > A recent kernel change removed efi_fake_mem support causing this test
> > to SKIP because no DAX regions can be found.
> >
> > Alas, a new source of DAX regions is available: CXL. Use that now.
> > Other than selecting a different region provider, the functionality
> > of the test remains the same.
>
> CXL looks like a useful replacement.
>
> > Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> > ---
> > test/daxctl-create.sh | 18 +++++++-----------
> > 1 file changed, 7 insertions(+), 11 deletions(-)
> >
> > diff --git a/test/daxctl-create.sh b/test/daxctl-create.sh
> > index d968e7bedd82..1ef70f2ff186 100755
> > --- a/test/daxctl-create.sh
> > +++ b/test/daxctl-create.sh
> > @@ -7,6 +7,9 @@ rc=77
> >
> > trap 'cleanup $LINENO' ERR
> >
> > +modprobe -r cxl_test
> > +modprobe cxl_test
> > +
> > cleanup()
> > {
> > printf "Error at line %d\n" "$1"
> > @@ -18,18 +21,10 @@ find_testdev()
> > {
> > local rc=77
> >
> > - # The hmem driver is needed to change the device mode, only
> > - # kernels >= v5.6 might have it available. Skip if not.
> > - if ! modinfo dax_hmem; then
> > - # check if dax_hmem is builtin
> > - if [ ! -d "/sys/module/device_hmem" ]; then
> > - printf "Unable to find hmem module\n"
> > - exit $rc
> > - fi
> > - fi
> > + # find a victim region provided by cxl_test
> > + bus="$("$CXL" list -b "$CXL_TEST_BUS" | jq -r '.[] | .bus')"
> > + region_id="$("$DAXCTL" list -R | jq -r ".[] | select(.path | contains(\"$bus\")) | .id")"
>
> Might as well skip using cxl-list and instead use the known
> platform device hosting the cxl_test CXL topology: "cxl_acpi.0"
>
> region_id="$("$DAXCTL" list -R | jq -r ".[] | select(.path | contains(\"cxl_acpi.0\")) | .id")"
Will do. Thanks for the review!
>
> ...other than that you can add:
>
> Reviewed-by: Dan Williams <dan.j.williams@intel.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ndctl PATCH 1/2] test/daxctl-create.sh: use bash math syntax to find available size
2024-08-28 3:14 ` [ndctl PATCH 1/2] test/daxctl-create.sh: use bash math syntax to find available size alison.schofield
@ 2024-09-03 21:28 ` Verma, Vishal L
0 siblings, 0 replies; 7+ messages in thread
From: Verma, Vishal L @ 2024-09-03 21:28 UTC (permalink / raw)
To: Schofield, Alison, nvdimm@lists.linux.dev; +Cc: linux-cxl@vger.kernel.org
On Tue, 2024-08-27 at 20:14 -0700, alison.schofield@intel.com wrote:
> From: Alison Schofield <alison.schofield@intel.com>
>
> The check for 1GB of available space in a DAX region always returned
> true due to being wrapped inside a [[ ... ]] test, even when space
> wasn't available. That caused set size to fail.
>
> Update to use bash arithmetic evaluation instead.
>
> This issue likely went unnoticed because users allocated >= 1GB of
> efi_fake_mem. This fix is part of the transition to use CXL regions
> in this test as efi_fake_mem support is being removed from the
> kernel.
>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> ---
> test/daxctl-create.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/test/daxctl-create.sh b/test/daxctl-create.sh
> index c093cb9e306a..d968e7bedd82 100755
> --- a/test/daxctl-create.sh
> +++ b/test/daxctl-create.sh
> @@ -363,7 +363,7 @@ daxctl_test6()
>
> # Use 2M by default or 1G if supported
> align=2097152
> - if [[ $((available >= 1073741824 )) ]]; then
> + if (( available >= 1073741824 )); then
Yikes, good find!
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
> align=1073741824
> size=$align
> fi
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ndctl PATCH 2/2] test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem
2024-08-28 3:14 ` [ndctl PATCH 2/2] test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem alison.schofield
2024-08-29 16:55 ` Dan Williams
@ 2024-09-04 0:34 ` Verma, Vishal L
1 sibling, 0 replies; 7+ messages in thread
From: Verma, Vishal L @ 2024-09-04 0:34 UTC (permalink / raw)
To: Schofield, Alison, nvdimm@lists.linux.dev; +Cc: linux-cxl@vger.kernel.org
On Tue, 2024-08-27 at 20:14 -0700, alison.schofield@intel.com wrote:
> From: Alison Schofield <alison.schofield@intel.com>
>
> This test tries to use DAX regions created from efi_fake_mem devices.
> A recent kernel change removed efi_fake_mem support causing this test
> to SKIP because no DAX regions can be found.
>
> Alas, a new source of DAX regions is available: CXL. Use that now.
> Other than selecting a different region provider, the functionality
> of the test remains the same.
>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Looks good,
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
> test/daxctl-create.sh | 18 +++++++-----------
> 1 file changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/test/daxctl-create.sh b/test/daxctl-create.sh
> index d968e7bedd82..1ef70f2ff186 100755
> --- a/test/daxctl-create.sh
> +++ b/test/daxctl-create.sh
> @@ -7,6 +7,9 @@ rc=77
>
> trap 'cleanup $LINENO' ERR
>
> +modprobe -r cxl_test
> +modprobe cxl_test
> +
> cleanup()
> {
> printf "Error at line %d\n" "$1"
> @@ -18,18 +21,10 @@ find_testdev()
> {
> local rc=77
>
> - # The hmem driver is needed to change the device mode, only
> - # kernels >= v5.6 might have it available. Skip if not.
> - if ! modinfo dax_hmem; then
> - # check if dax_hmem is builtin
> - if [ ! -d "/sys/module/device_hmem" ]; then
> - printf "Unable to find hmem module\n"
> - exit $rc
> - fi
> - fi
> + # find a victim region provided by cxl_test
> + bus="$("$CXL" list -b "$CXL_TEST_BUS" | jq -r '.[] | .bus')"
> + region_id="$("$DAXCTL" list -R | jq -r ".[] | select(.path |
> contains(\"$bus\")) | .id")"
>
> - # find a victim region provided by dax_hmem
> - region_id="$("$DAXCTL" list -R | jq -r '.[] | select(.path |
> contains("hmem")) | .id')"
> if [[ ! "$region_id" ]]; then
> printf "Unable to find a victim region\n"
> exit "$rc"
> @@ -413,4 +408,5 @@ daxctl_test5
> daxctl_test6
> daxctl_test7
> reset_dev
> +modprobe -r cxl_test
> exit 0
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-09-04 0:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 3:14 [ndctl PATCH 0/2] Use CXL regions in daxctl-create unit test alison.schofield
2024-08-28 3:14 ` [ndctl PATCH 1/2] test/daxctl-create.sh: use bash math syntax to find available size alison.schofield
2024-09-03 21:28 ` Verma, Vishal L
2024-08-28 3:14 ` [ndctl PATCH 2/2] test/daxctl-create.sh: use CXL DAX regions instead of efi_fake_mem alison.schofield
2024-08-29 16:55 ` Dan Williams
2024-08-29 20:50 ` Alison Schofield
2024-09-04 0:34 ` Verma, Vishal L
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox