This is a three-part fixup to the warning that occurs when the available
capacity is fragmented. When this occurs, the user may believe they can
create a larger namespace than is actually possible. This was resulting
in the following kernel warning:

  nd_region region0: allocation underrun: 0x0 of 0x1400000000 bytes
  WARNING: CPU: 32 PID: 1975 at drivers/nvdimm/namespace_devs.c:913 
size_store+0x879/0x8d0 [libnvdimm]

The kernel side of this determines the maximum size by calculating the
largest contiguous extent that can be allocated. If the requested size
exceeds that, an error is returned early instead of reaching the
alarming kernel warning.

To make it possible for the user to know the maximum size it may
request, a new attribute is exported that shows the largest available
extent.

Finally, separate from this series, ndctl is updated to make use of this
new attribute when creating a namespace.

Keith Busch (2):
  libnvdimm: Use largest contiguous area for namespace size
  libnvdimm: Export max available extent

 drivers/nvdimm/dimm_devs.c      | 29 +++++++++++++++++++++++++++++
 drivers/nvdimm/namespace_devs.c |  2 +-
 drivers/nvdimm/nd-core.h        |  3 +++
 drivers/nvdimm/region_devs.c    | 39 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 72 insertions(+), 1 deletion(-)

-- 
2.14.3

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

Reply via email to