Open sscargal opened 2 years ago
We will take a look at it.
Have reverted to retrieving free capacity by scraping ipmctl cli output (actually because nvm_get_regions_ex(use_nfit=false, ...) takes a minute to return) but it would be preferable to be able to use libipmctl api. I found that setting use_nfit=false and calling nvm_uninit() between calls results in the FreeCapacity stat being updated as expected. Unfortunately the latency in the call is not acceptable hence the reason for the switch.
This issue was originally reported on the #pmem Slack channel by Tom Nabarro:
I responded with:
After investigating further, the following C++ code reproduces Tom's issue:
Returns:
One would expect the
free_capacity
to have been calculated and should be zero (0) on my system as demonstrated byipmctl show -region
:nvm_get_regions() calls nvm_get_regions_ex() which populates the region struct with the results from gNvmDimmDriverNvmDimmConfig.GetRegions()
From nvm_management.c:
Where
Note, the comment for FreeCapacity says "Region total free capacity. Raw less capacity used by namespaces", so this isn't working as documented.