From: Igor Mammedov <imammedo@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: libvir-list@redhat.com, haozhong.zhang@intel.com,
yi.z.zhang@linux.intel.com, qemu-devel@nongnu.org,
pbonzini@redhat.com
Subject: Re: [PATCH] Deprecate pmem=on with non-DAX capable backend file
Date: Tue, 29 Dec 2020 21:11:17 +0100 [thread overview]
Message-ID: <20201229211117.1e900ec6@redhat.com> (raw)
In-Reply-To: <328c04e7-4ddb-82f6-16e4-ce8f692ff753@redhat.com>
On Tue, 29 Dec 2020 19:04:58 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> On 12/29/20 6:29 PM, Igor Mammedov wrote:
> > It is not safe to pretend that emulated NVDIMM supports
> > persistence while backend actually failed to enable it
> > and used non-persistent mapping as fall back.
> > Instead of falling-back, QEMU should be more strict and
> > error out with clear message that it's not supported.
> > So if user asks for persistence (pmem=on), they should
> > store backing file on NVDIMM.
> >
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > ---
> > docs/system/deprecated.rst | 14 ++++++++++++++
> > util/mmap-alloc.c | 3 +++
> > 2 files changed, 17 insertions(+)
> >
> > diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
> > index bacd76d7a5..ba4f6ed2fe 100644
> > --- a/docs/system/deprecated.rst
> > +++ b/docs/system/deprecated.rst
> > @@ -327,6 +327,20 @@ The Raspberry Pi machines come in various models (A, A+, B, B+). To be able
> > to distinguish which model QEMU is implementing, the ``raspi2`` and ``raspi3``
> > machines have been renamed ``raspi2b`` and ``raspi3b``.
> >
> > +Backend options
> > +---------------
> > +
> > +Using non-persistent backing file with pmem=on (since 6.0)
> > +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> > +
> > +This option is used when ``memory-backend-file`` is consumed by emulated NVDIMM
> > +device. However enabling ``memory-backend-file.pmem`` option, when backing file
> > +is not DAX capable or not on a filesystem that support direct mapping of persistent
>
> Maybe clearer enumerating? As:
> "is a) not DAX capable or b) not on a filesystem that support direct
> mapping of persistent"
will change it to your variant in v2
>
> > +memory, is not safe and may lead to data loss or corruption in case of host crash.
> > +Using pmem=on option with such file will return error, instead of a warning.
>
> Not sure the difference between warn/err is important in the doc.
not many care about warnings until QEMU starts fine,
I've mentioned error here so that whomever reading this would know what to expect
>
> > +Options are to move backing file to NVDIMM storage or modify VM configuration
> > +to set ``pmem=off`` to continue using fake NVDIMM without persistence guaranties.
>
> Maybe:
>
> The possibilities to continue using fake NVDIMM (without persistence
> guaranties) are:
> - move backing file to NVDIMM storage
> - modify VM configuration to set ``pmem=off``
only the later is faking nvdimm, the first is properly emulated one with persistence guaranties.
Maybe:
Options are:
- modify VM configuration to set ``pmem=off`` to continue using fake NVDIMM
(without persistence guaranties) on with backing file on non DAX storage
- move backing file to NVDIMM storage and keep ``pmem=on``,
to have NVDIMM with persistence guaranties.
> > +
> > Device options
> > --------------
> >
> > diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
> > index 27dcccd8ec..d226273a98 100644
> > --- a/util/mmap-alloc.c
> > +++ b/util/mmap-alloc.c
> > @@ -20,6 +20,7 @@
> > #include "qemu/osdep.h"
> > #include "qemu/mmap-alloc.h"
> > #include "qemu/host-utils.h"
> > +#include "qemu/error-report.h"
> >
> > #define HUGETLBFS_MAGIC 0x958458f6
> >
> > @@ -166,6 +167,8 @@ void *qemu_ram_mmap(int fd,
> > "crash.\n", file_name);
> > g_free(proc_link);
> > g_free(file_name);
> > + warn_report("Deprecated using non DAX backing file with"
> > + " pmem=on option");
>
> Maybe "Using non DAX backing file with 'pmem=on' option is deprecated"?
ok
>
> Beside the nitpicking comments,
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> > }
> > /*
> > * if map failed with MAP_SHARED_VALIDATE | MAP_SYNC,
> >
>
next prev parent reply other threads:[~2020-12-29 20:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-29 17:29 [PATCH] Deprecate pmem=on with non-DAX capable backend file Igor Mammedov
2020-12-29 18:04 ` Philippe Mathieu-Daudé
2020-12-29 20:11 ` Igor Mammedov [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-01-11 20:33 Igor Mammedov
2021-01-20 19:31 ` Igor Mammedov
2021-01-20 21:35 ` Philippe Mathieu-Daudé
2021-02-09 16:09 ` Igor Mammedov
2021-04-27 20:48 ` Eduardo Habkost
2021-04-28 16:29 ` Eduardo Habkost
2021-05-03 12:14 ` Igor Mammedov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201229211117.1e900ec6@redhat.com \
--to=imammedo@redhat.com \
--cc=haozhong.zhang@intel.com \
--cc=libvir-list@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yi.z.zhang@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).