Skip to contentSkip to conversation

ND_MIN_NAMESPACE_SIZE

DISCUSSION Soccer Liu 2 participants 3 messages Jul 1, 2017 2 messages not in the archive libnvdimm: non-volatile memory device

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Soccer Liu

author
#1 lore raw

Hi all:
 I noticed that ND_MIN_NAMESPACE_SIZE is defined as 4MB.
nvdimm_namespace_common_probe(..){..
   if (size < ND_MIN_NAMESPACE_SIZE) {
 dev_dbg(&ndns->dev, "%pa, too small must be at least %#x\n",
 &size, ND_MIN_NAMESPACE_SIZE);
 return ERR_PTR(-ENODEV);
 }...}
In our configuration, we have a host based software enumerated PMEM device that could be much smaller than 4MB.Because of above failure, no PMEM device was exposed. I changed ND_MIN_NAMESPACE_SIZE to smaller size (such as 256 KB) and a smaller size (<4MB) Persistent Memory starts working.Is there any reason that it cannot be smaller? Thanks
Cheng-mean
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

#2 lore raw

4M was picked as the smallest "reasonable" size for a disk. We could make it smaller, but what is the use case?

Quoted 8 lines · Soccer Liu

Hi all:
I noticed that ND_MIN_NAMESPACE_SIZE is defined as 4MB.
nvdimm_namespace_common_probe(..){..
if (size < ND_MIN_NAMESPACE_SIZE) {
dev_dbg(&ndns->dev, "%pa, too small must be at least %#x\n", &size, ND_MIN_NAMESPACE_SIZE);
return ERR_PTR(-ENODEV);
}...}

Quoted 8 lines

In our configuration, we have a host based software enumerated PMEM device that could be much smaller than 4MB.Because of above failure, no PMEM device was exposed. I changed ND_MIN_NAMESPACE_SIZE to smaller size (such as 256 KB) and a smaller size (<4MB) Persistent Memory starts working.Is there any reason that it cannot be smaller? Thanks
Cheng-mean
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

A message that is not in the archive (sent off-list or not yet received): CAPcyv4hiWY-6Bdf=U1QR+bCVvPy8Fq+eaL0+-qzLvbpcEuwn4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#4 lore raw

Here is our usage case:

We are trying to represent each Docker container image layer in a read-only persist memory device before injecting into a guest Linux VM for constructing a union file system as part of the container execution preparation task.
Those read-only persistent memory devices are RAM emulated, not the real PMEM devices. Their sizes are very flexible. On top of that, the sizes of those docker layers could be well below 4MB. Looking at the nvdimm code, NV_MIN_NAMESPACE does not seem to be used in any other context other than the initial size checking. So I built a private kernel with a redefined NV_MIN_NAMESPACE_SIZE to much smaller number, such 64kb, and the persistent memory devices for smaller layers start functioning as expected.

Thanks
Cheng-mean

Quoted 22 lines · Dan Williams

4M was picked as the smallest "reasonable" size for a disk. We could make it smaller, but what is the use case?

Quoted 17 lines · Soccer Liu

Hi all:
I noticed that ND_MIN_NAMESPACE_SIZE is defined as 4MB.
nvdimm_namespace_common_probe(..){..
if (size < ND_MIN_NAMESPACE_SIZE) {
dev_dbg(&ndns->dev, "%pa, too small must be at least %#x\n",
&size, ND_MIN_NAMESPACE_SIZE);
return ERR_PTR(-ENODEV);
}...}
In our configuration, we have a host based software enumerated PMEM device that could be much smaller than 4MB.Because of above failure, no PMEM device was exposed. I changed ND_MIN_NAMESPACE_SIZE to smaller size (such as 256 KB) and a smaller size (<4MB) Persistent Memory starts working.Is there any reason that it cannot be smaller? Thanks
Cheng-mean
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm