> >
> > This warning seems to be the following line.
> > ---
> > static int grow_dpa_allocation(struct nd_region *nd_region,
> >                 struct nd_label_id *label_id, resource_size_t n)
> > {
> >         struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(&nd_region->dev);
> >         bool is_pmem = strncmp(label_id->id, "pmem", 4) == 0;
> >         int i;
> >   :
> >   :
> >                 }
> >
> >                 dev_WARN_ONCE(&nd_region->dev, rem,                         
> >        <----!!!
> >                                 "allocation underrun: %#llx of %#llx 
> > bytes\n",     <----!!!
> >                                 (unsigned long long) n - rem,               
> >        <----!!!
> >                                 (unsigned long long) n);                    
> >        <----!!!
> >
> 
> Yes, this appears to be a kernel bug from when
> multiple-namespaces-per-region support was added. The accounting of
> free space that ndctl relies on assumes that all free space is
> contiguous. This assumption was correct in the original
> implementation, but not since commit:
> 
>     a1f3e4d6a0c3 libnvdimm, region: update nd_region_available_dpa()
> for multi-pmem support
> 
> The fix has 3 parts:
> 
> 1/ The kernel needs to fail attempts to allocate discontiguous free space
> 
> 2/ The kernel needs a new sysfs attribute to export the maximum
> contiguous free space range
> 
> 3/ ndctl needs to be updated to pick the max contiguous size rather
> than the max free space


Agree. 

Unfortunately, I cound not use the real NVDIMM box which I found this bug now,
because the box is very busy, and the environment will be available
a few months later.

If other person can make the above fixes, it will be faster than me.

Anyone?


> 
> Alternatively we could teach the kernel to support discontiguous pmem
> namespaces, but we would need to check if the EFI namespace
> specification allows for such a configuration.
> 

I suppose this way is not good way probably.


Though I searched EFI specification 2.7a, 
it says just the followings about contiguous namespace,
and I couldn't find any other description.

 ---
 6.1 Block Translation Table (BTT) Background
 A namespace defines a contiguously-addressed range of Non-Volatile Memory
 conceptually similar to a SCSI Logical Unit (LUN) or a NVM Express
 namespace.
 ---

I also searched "NVDIMM Namespace Specification"
https://pmem.io/documents/NVDIMM_Namespace_Spec.pdf

It say the followings
 ---
 2.6 I/O on Namespaces
 A Persistent Memory namespace, by definition, is a contiguous range
 of System Physical Address space."
 ---

So, I could not think that speficications allows discontigous
pmem namespace.

Thanks,
---
Yasunori Goto




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

Reply via email to