How to create namespace for a emulated pmem region by dram

31 views
Skip to first unread message

宇晗杨

unread,
Oct 25, 2022, 8:29:37 AM10/25/22
to pmem
Hi all
I want to build a project which uses persistent memory while my machine doesn't have one. So I followed the tutorial to emulate persistent memory with dram. It worked well before I tried to create a new namespace.

I entered the command `sudo ndctl create-namespace -m dax --region=region0 --size=20G -v`. However, it showed that 
`namespace_create:770: region0: insufficient capacity size: 500000000 avail: 0
failed to create namespace: Resource temporarily unavailable`.

The result of command `ndctl list --regions` is below.
{
  "dev":"region0",
  "size":42949672960,
  "available_size":0,
  "type":"pmem",
  "persistence_domain":"unknown"
}
So the emulated pmem region's `available_size` is 0. How to make this area available for creating a namespace?

Jeff Moyer

unread,
Oct 25, 2022, 2:17:09 PM10/25/22
to 宇晗杨, pmem
宇晗杨 <yangfi...@gmail.com> writes:

> Hi all
> I want to build a project which uses persistent memory while my machine
> doesn't have one. So I followed the tutorial
> <https://pmem.io/blog/2016/02/how-to-emulate-persistent-memory/> to emulate
> persistent memory with dram. It worked well before I tried to create a new
> namespace.

So you used the memmap=NN!MM kernel command line option, yes? (And
hopefully you have created that mapping in a region of system ram...)
That should create a default namespace. You can't create new ones, you
can only reconfigure the existing one.

Cheers,
Jeff

宇晗杨

unread,
Oct 25, 2022, 9:43:48 PM10/25/22
to Jeff Moyer, pmem
Yes, I used the command line in grub "memmap=40G!4G". Reconfiguring the existing `namespace0.0` solves the problem. Thanks a lot!


--

Sincerely,

Yuhan Yang

Reply all
Reply to author
Forward
0 new messages