Linux Support for NVM technology

Steps:


  1. Download the NVDIMM Kernel Tree
  2. Compile kernel with the following configurations to enable PMEM and DAX support.
    • CONFIG_BLK_DEV_RAM_DAX=y
      CONFIG_FS_DAX=y
      CONFIG_X86_PMEM_LEGACY=y
      CONFIG_LIBNVDIMM=y
      CONFIG_BLK_DEV_PMEM=m
      CONFIG_ARCH_HAS_PMEM_API=y
  3. If you have NVDIMMs, then you should have kernel support. If you don’t have NVDIMMs, you can still test the new PMEM features via volatile memory (i.e. DRAM ) mapping.
  4. Volatile memory mapping
    1. check your dmsg and find the usable memory range:
      1. Capture
      2. You can see physical memory after 0x00000001000000000 (4G) is useable.
    2. Set the kernel parameter in the GRUB memmap=16G!4G. You will reserve a 12GB physical memory  after 4G address , and Linux will treat this memory as a PMEM.
    3. Reboot
  5. Check if you have pmem device
    1. ls /dev/pmem0
    2. fdisk -l /dev/pmem0Disk /dev/pmem0: 16 GiB, 17179869184 bytes, 33554432 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes
  6. Format ext4 file system and mount
    1.  mkdir /mnt/pmem
    2. mkfs.ext4 -F -b 4096 /dev/pmem0
    3. mount -o dax /dev/pmem0 /mnt/pmem

Links:


NVDIMM Kernel Tree: https://git.kernel.org/cgit/linux/kernel/git/nvdimm/nvdimm.git

NDCTL: https://github.com/pmem/ndctl.git

ACPI 6: http://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf

NVDIMM Namespace: http://pmem.io/documents/NVDIMM_Namespace_Spec.pdf

DSM Interface Example: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf

Driver Writer’s Guide: http://pmem.io/documents/NVDIMM_Driver_Writers_Guide.pdf

 

This entry was posted in memory, non-volatile memory. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *