[PATCH] docs/nvdimm: add 'pmem=on' for the device dax backend file

Jingqi Liu posted 1 patch 3 years, 9 months ago
Test checkpatch passed
Test docker-mingw@fedora passed
Test FreeBSD passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200715025429.28657-1-jingqi.liu@intel.com
There is a newer version of this series
docs/nvdimm.txt | 7 +++++++
1 file changed, 7 insertions(+)
[PATCH] docs/nvdimm: add 'pmem=on' for the device dax backend file
Posted by Jingqi Liu 3 years, 9 months ago
At the end of live migration, QEMU uses msync() to flush the data to
the backend storage. When the backend file is a character device dax,
the pages explicitly avoid the page cache. It will return failure from msync().
The following warning is output.

    "warning: qemu_ram_msync: failed to sync memory range“

So we add 'pmem=on' to avoid calling msync(), use the QEMU command line:

    -object memory-backend-file,id=mem1,pmem=on,mem-path=/dev/dax0.0,size=4G

Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
---
 docs/nvdimm.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt
index c2c6e441b3..31048aff5e 100644
--- a/docs/nvdimm.txt
+++ b/docs/nvdimm.txt
@@ -243,6 +243,13 @@ use the QEMU command line:
 
     -object memory-backend-file,id=nv_mem,mem-path=/XXX/yyy,size=4G,pmem=on
 
+At the end of live migration, QEMU uses msync() to flush the data to the
+backend storage. When the backend file is a character device dax, the pages
+explicitly avoid the page cache. It will return failure from msync().
+So we add 'pmem=on' to avoid calling msync(), use the QEMU command line:
+
+    -object memory-backend-file,id=mem1,pmem=on,mem-path=/dev/dax0.0,size=4G
+
 References
 ----------
 
-- 
2.17.1


Re: [PATCH] docs/nvdimm: add 'pmem=on' for the device dax backend file
Posted by Liu, Jingqi 3 years, 9 months ago
Ping for comments.


On 7/15/2020 10:54 AM, Liu, Jingqi wrote:
> At the end of live migration, QEMU uses msync() to flush the data to
> the backend storage. When the backend file is a character device dax,
> the pages explicitly avoid the page cache. It will return failure from msync().
> The following warning is output.
>
>      "warning: qemu_ram_msync: failed to sync memory range“
>
> So we add 'pmem=on' to avoid calling msync(), use the QEMU command line:
>
>      -object memory-backend-file,id=mem1,pmem=on,mem-path=/dev/dax0.0,size=4G
>
> Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
> ---
>   docs/nvdimm.txt | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt
> index c2c6e441b3..31048aff5e 100644
> --- a/docs/nvdimm.txt
> +++ b/docs/nvdimm.txt
> @@ -243,6 +243,13 @@ use the QEMU command line:
>   
>       -object memory-backend-file,id=nv_mem,mem-path=/XXX/yyy,size=4G,pmem=on
>   
> +At the end of live migration, QEMU uses msync() to flush the data to the
> +backend storage. When the backend file is a character device dax, the pages
> +explicitly avoid the page cache. It will return failure from msync().
> +So we add 'pmem=on' to avoid calling msync(), use the QEMU command line:
> +
> +    -object memory-backend-file,id=mem1,pmem=on,mem-path=/dev/dax0.0,size=4G
> +
>   References
>   ----------
>   

Re: [PATCH] docs/nvdimm: add 'pmem=on' for the device dax backend file
Posted by Liu, Jingqi 3 years, 9 months ago
Hi Paolo,

Any comments for this patch ?

Thanks,

Jingqi

On 7/15/2020 10:54 AM, Liu, Jingqi wrote:
> At the end of live migration, QEMU uses msync() to flush the data to
> the backend storage. When the backend file is a character device dax,
> the pages explicitly avoid the page cache. It will return failure from msync().
> The following warning is output.
>
>      "warning: qemu_ram_msync: failed to sync memory range“
>
> So we add 'pmem=on' to avoid calling msync(), use the QEMU command line:
>
>      -object memory-backend-file,id=mem1,pmem=on,mem-path=/dev/dax0.0,size=4G
>
> Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
> ---
>   docs/nvdimm.txt | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/docs/nvdimm.txt b/docs/nvdimm.txt
> index c2c6e441b3..31048aff5e 100644
> --- a/docs/nvdimm.txt
> +++ b/docs/nvdimm.txt
> @@ -243,6 +243,13 @@ use the QEMU command line:
>   
>       -object memory-backend-file,id=nv_mem,mem-path=/XXX/yyy,size=4G,pmem=on
>   
> +At the end of live migration, QEMU uses msync() to flush the data to the
> +backend storage. When the backend file is a character device dax, the pages
> +explicitly avoid the page cache. It will return failure from msync().
> +So we add 'pmem=on' to avoid calling msync(), use the QEMU command line:
> +
> +    -object memory-backend-file,id=mem1,pmem=on,mem-path=/dev/dax0.0,size=4G
> +
>   References
>   ----------
>   

Re: [PATCH] docs/nvdimm: add 'pmem=on' for the device dax backend file
Posted by Stefan Hajnoczi 3 years, 9 months ago
On Wed, Jul 15, 2020 at 10:54:29AM +0800, Jingqi Liu wrote:
> At the end of live migration, QEMU uses msync() to flush the data to
> the backend storage. When the backend file is a character device dax,
> the pages explicitly avoid the page cache. It will return failure from msync().
> The following warning is output.
> 
>     "warning: qemu_ram_msync: failed to sync memory range“
> 
> So we add 'pmem=on' to avoid calling msync(), use the QEMU command line:
> 
>     -object memory-backend-file,id=mem1,pmem=on,mem-path=/dev/dax0.0,size=4G
> 
> Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
> ---
>  docs/nvdimm.txt | 7 +++++++
>  1 file changed, 7 insertions(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>