persistent memory simulation

PMEM simulation

  1. make sure the kernel version is 4.x;

  2. edit /etc/default/grub:

    1
    GRUB_CMDLINE_LINUX="memmap=nn[KMG]!ss[KMG]"

    this command reserve physical memory region [ss, ss + nn], the unit could be [KB, MB, GB];

    if more than one persistent memory is needed, add more command:

    1
    GRUB_CMDLINE_LINUX="memmap=nn1[KMG]!ss1[KMG] memmap=nn2[KMG]!ss2[KMG]"
  3. execute grub-mkconfig -o /boot/grub/grub.cfg to update grub;

  4. reboot, and new persistent memory will be shown as /dev/pmem[01234...]