fail to use GRUB_CMDLINE_LINUX="memmap=8G!4G"

33 views
Skip to first unread message

花昱圣

unread,
Sep 19, 2024, 10:51:48 PM9/19/24
to cloudlab-users
Dear managers:
    I was trying to use 'memmap' to reserve a part of memory to emulate pmem. However, although the kernel supports this function, the 'memmap' can not work after I reboot the node. I wonder if it is the Cloudlab setting that forbids users to do so? 
   
    node: c6525-100g
    OS:ubuntu18-64-STD
    kernel version: 4.15.0-169-generic

    BTW, I also tried other nodes (like c220g2) and other newer OS (ubuntu22, centos9), it can not work as well.
    Thanks. Regards

David M Johnson

unread,
Sep 20, 2024, 10:13:04 AM9/20/24
to cloudla...@googlegroups.com
Hi. I'm not sure what you mean by not working; variants of your params
work fine for me. You might not have the effect you're looking for
without using a machine that actually has persistent memory (e.g.
optane), but the kernel will still protect the regions you specify.
Make sure you have grub properly configured and that your settings
persist after reboot. I did it this way:

* Edit the final `GRUB_CMDLINE_LINUX_DEFAULT` var in
`/etc/default/grub` to include `memmap=4G!8G memmap=2G!16G`
* `sudo update-grub`
* reboot

Then you can observe the protected regions in a variety of ways:

`cat /proc/iomem` (snip):

200000000-2ffffffff : Persistent Memory (legacy)
200000000-2ffffffff : namespace0.0
400000000-47fffffff : Persistent Memory (legacy)
400000000-47fffffff : namespace1.0

`sudo fdisk -l /dev/pmem0`:

Disk /dev/pmem0: 4 GiB, 4294967296 bytes, 8388608 sectors


David

花昱圣

unread,
Sep 20, 2024, 12:52:47 PM9/20/24
to cloudla...@googlegroups.com
Hi, thanks for your help, it works by following your instructions. 
The reason why I cannot create the virtual pmem is because i put the 'memmap' function in a new GRUB_CMDLINE_LINUX instead of GRUB_CMDLINE_LINUX_DEFAULT.
Thanks again!
Best.

David M Johnson <john...@flux.utah.edu> 于2024年9月20日周五 22:13写道:
--
You received this message because you are subscribed to the Google Groups "cloudlab-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudlab-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudlab-users/6dce5fe4-5606-4a8d-a9a7-0127b6d5f880%40flux.utah.edu.
Reply all
Reply to author
Forward
0 new messages