Skip to content

Instantly share code, notes, and snippets.

@xterat
Last active July 31, 2017 02:31
Show Gist options
  • Save xterat/428e0d4d89f203a7071419e421d26c7f to your computer and use it in GitHub Desktop.
Save xterat/428e0d4d89f203a7071419e421d26c7f to your computer and use it in GitHub Desktop.

PMEM emulation

  1. make sure the kernel version is 4.x;
  2. edit /etc/default/grub:
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:

GRUB_CMDLINE_LINUX="memmap=nn1[KMG]!ss1[KMG] memmap=nn2[KMG]!ss2[KMG]"
  1. execute grub-mkconfig -o /boot/grub/grub.cfg to update grub;
  2. reboot, and new persistent memory will be shown as /dev/pmem[01234...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment