On 08/11/2016 04:12 PM, Michal Privoznik wrote:
On 04.08.2016 10:42, Stefan Hajnoczi wrote:
> On Mon, Aug 1, 2016 at 4:10 PM, Michal Privoznik <mprivozn(a)redhat.com> wrote:
>> NVDIMM was introduced to qemu in v2.6.0-rc0~248^2~25. So it's
>> been a while since then.
>>
>> It's not the next big thing, but it is very interesting feature
>> enabling higher performance as reading/writing to the module (and
>> subsequently to the file on the host) does not require a VMEXIT.
>> It can be used to access host files directly bypassing page cache
>> whilst doing so.
>>
>>
>> How to test the feature?
>> 1) you need PMEM enabled kernel:
>> CONFIG_LIBNVDIMM=y
>> CONFIG_BLK_DEV_PMEM=m
>> CONFIG_ACPI_NFIT=m
>>
>> 2) Create a file in the host:
>> truncate -s 512M /tmp/nvdimm
>>
>> 3) Add the following to the domain XML:
>>
>> <memory model='nvdimm' memAccess='shared'>
>> <source>
>> <path>/tmp/nvdimm</path>
>> </source>
>> <target>
>> <size unit='KiB'>523264</size>
>> <node>0</node>
>> </target>
>> </memory>
>
> The "nvdimm" device also has a label-size property. This determines
> the size of the Namespace Label area described in:
>
http://pmem.io/documents/NVDIMM_Namespace_Spec.pdf
>
> By default no Namespace Label area is reserved in the file. If the
> user specifies label-size then the memory at the end of the file is
> used as the Namespace Label area.
>
> It is necessary to expose label-size so users can choose whether or
> not to have a Namespace Label area.
>
> I have CCed Guangrong Xiao who authored the QEMU patches.
>
Ah, thank you for that. From the code I understand that the minimum
value for that is 128K, but what about other restrictions? Does the
number need to be aligned? What is the minimal step between two
different values?
Michal,
The are only two restrictions:
1) the minimum label size is 128K as you pointed out.
2) the remaining size (total-size - label-size, which is used for PMEM) alined with
4k for normal backend or hugepage-size for hugetlbfs can not be 0.
Thanks!