pmem / ndctl

A "device memory" enabling project encompassing tools and libraries for CXL, NVDIMMs, DAX, memory tiering and other platform memory device topics.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ndctl test suite daxctl-devices.sh failed to reconfigure one 256M devdax

yizhanglinux opened this issue · comments

The test daxctl-devices.sh trying to reconfigure one 256M devdax and failed with "Invalid argument", I tried to change the size to 4G and it works, is that expected?

# ./ndctl destroy-namespace -f -b ACPI.NFIT namespace1.0
libndctl: ndctl_namespace_enable: namespace1.0: failed to enable
  Error: destroy namespace: namespace1.0 failed to enable for zeroing, continuing

destroyed 1 namespace
# ./ndctl create-namespace -b ACPI.NFIT -m devdax -fe namespace1.0 -s 256M
libndctl: ndctl_namespace_enable: namespace1.0: failed to enable
  Error: create namespace: namespace1.0 failed to enable for zeroing, continuing

{
  "dev":"namespace1.0",
  "mode":"devdax",
  "map":"dev",
  "size":"250.00 MiB (262.14 MB)",
  "uuid":"4a097071-6c15-433f-a8a2-b88ff8197060",
  "daxregion":{
    "id":1,
    "size":"250.00 MiB (262.14 MB)",
    "align":2097152,
    "devices":[
      {
        "chardev":"dax1.0",
        "size":"250.00 MiB (262.14 MB)",
        "target_node":1,
        "align":2097152,
        "mode":"devdax"
      }
    ]
  },
  "align":2097152,
  "name":"test_pmem"
}
# cat /sys/devices/system/memory/auto_online_blocks 
offline

# ./daxctl reconfigure-device -N -m system-ram dax1.0
libdaxctl: daxctl_dev_enable: dax1.0: failed to enable
error reconfiguring devices: Invalid argument
reconfigured 0 devices

# dmesg
[ 7923.226742] kmem dax1.0: mapping0: 0x1080600000-0x108fffffff too small after alignment
[ 7923.226758] kmem dax1.0: rejecting DAX region without any memory after alignment
[ 7923.234182] kmem: probe of dax1.0 failed with error -22
[ 7923.248311] memmap_init_zone_device initialised 64000 pages in 2ms
[ 7967.753099] kmem dax1.0: mapping0: 0x1080600000-0x108fffffff too small after alignment
[ 7967.753110] kmem dax1.0: rejecting DAX region without any memory after alignment
[ 7967.760525] kmem: probe of dax1.0 failed with error -22
[ 7967.766828] kmem dax1.0: mapping0: 0x1080600000-0x108fffffff too small after alignment
[ 7967.766836] kmem dax1.0: rejecting DAX region without any memory after alignment
[ 7967.774249] kmem: probe of dax1.0 failed with error -22

What does /sys/devices/system/memory/block_size_bytes report? It is possible that after removing metadata and alignment space from the 256MiB namespace, there isn't a full memory block available to online. The dmesg points to this as well.

If the unit test was picking a 256M namespace, we should probably detect that and skip the test. I suspect 512M will also work, shouldn't need as large as 4G.

It's 80000000, I tried 512M and 3G, also failed.

# cat /sys/devices/system/memory/block_size_bytes
80000000

# uname -ri
6.4.0-rc1+ x86_64

# ./ndctl destroy-namespace -f -b ACPI.NFIT namespace1.0
libndctl: ndctl_namespace_enable: namespace1.0: failed to enable
  Error: destroy namespace: namespace1.0 failed to enable for zeroing, continuing

destroyed 1 namespace

# ndctl create-namespace -b ACPI.NFIT -m devdax -fe namespace1.0 -s 512M
libndctl: ndctl_namespace_enable: namespace1.0: failed to enable
  Error: create namespace: namespace1.0 failed to enable for zeroing, continuing

{
  "dev":"namespace1.0",
  "mode":"devdax",
  "map":"dev",
  "size":"502.00 MiB (526.39 MB)",
  "uuid":"3110f9c7-f9ad-407a-8b5c-0e76b2384aba",
  "daxregion":{
    "id":1,
    "size":"502.00 MiB (526.39 MB)",
    "align":2097152,
    "devices":[
      {
        "chardev":"dax1.0",
        "size":"502.00 MiB (526.39 MB)",
        "target_node":1,
        "align":2097152,
        "mode":"devdax"
      }
    ]
  },
  "align":2097152,
  "name":"test_pmem"
}

# ./daxctl reconfigure-device -N -m system-ram dax1.0
libdaxctl: daxctl_dev_enable: dax1.0: failed to enable
error reconfiguring devices: Invalid argument
reconfigured 0 devices

# ./ndctl create-namespace -b ACPI.NFIT -m devdax -fe namespace1.0 -s 3G
{
  "dev":"namespace1.0",
  "mode":"devdax",
  "map":"dev",
  "size":"2.95 GiB (3.17 GB)",
  "uuid":"c79cc66b-1bd4-463c-b8d8-20ee0841ed5d",
  "daxregion":{
    "id":1,
    "size":"2.95 GiB (3.17 GB)",
    "align":2097152,
    "devices":[
      {
        "chardev":"dax1.0",
        "size":"2.95 GiB (3.17 GB)",
        "target_node":1,
        "align":2097152,
        "mode":"devdax"
      }
    ]
  },
  "align":2097152,
  "name":"test_pmem"
}

# ./daxctl reconfigure-device -N -m system-ram dax1.0
libdaxctl: daxctl_dev_enable: dax1.0: failed to enable
error reconfiguring devices: Invalid argument
reconfigured 0 devices