From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Beata Michalska <beata.michalska@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
quintela@redhat.com,
Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, shameerali.kolothum.thodi@huawei.com,
eric.auger@redhat.com, qemu-arm@nongnu.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/4] migration: ram: Switch to ram block writeback
Date: Wed, 11 Sep 2019 11:36:45 +0100 [thread overview]
Message-ID: <20190911103645.GF2894@work-vm> (raw)
In-Reply-To: <CADSWDzuuWqBF9rP57Zv7jFPKUhFdVLq-O_uqs29i4dAFz+CgUA@mail.gmail.com>
* Beata Michalska (beata.michalska@linaro.org) wrote:
> On Tue, 10 Sep 2019 at 14:16, Dr. David Alan Gilbert
> <dgilbert@redhat.com> wrote:
> >
> > * Beata Michalska (beata.michalska@linaro.org) wrote:
> > > On Tue, 10 Sep 2019 at 12:26, Dr. David Alan Gilbert
> > > <dgilbert@redhat.com> wrote:
> > > >
> > > > * Beata Michalska (beata.michalska@linaro.org) wrote:
> > > > > Switch to ram block writeback for pmem migration.
> > > > >
> > > > > Signed-off-by: Beata Michalska <beata.michalska@linaro.org>
> > > > > ---
> > > > > migration/ram.c | 5 +----
> > > > > 1 file changed, 1 insertion(+), 4 deletions(-)
> > > > >
> > > > > diff --git a/migration/ram.c b/migration/ram.c
> > > > > index b01a37e7ca..8ea0bd63fc 100644
> > > > > --- a/migration/ram.c
> > > > > +++ b/migration/ram.c
> > > > > @@ -33,7 +33,6 @@
> > > > > #include "qemu/bitops.h"
> > > > > #include "qemu/bitmap.h"
> > > > > #include "qemu/main-loop.h"
> > > > > -#include "qemu/pmem.h"
> > > > > #include "xbzrle.h"
> > > > > #include "ram.h"
> > > > > #include "migration.h"
> > > > > @@ -4064,9 +4063,7 @@ static int ram_load_cleanup(void *opaque)
> > > > > RAMBlock *rb;
> > > > >
> > > > > RAMBLOCK_FOREACH_NOT_IGNORED(rb) {
> > > > > - if (ramblock_is_pmem(rb)) {
> > > > > - pmem_persist(rb->host, rb->used_length);
> > > > > - }
> > > > > + qemu_ram_block_writeback(rb);
> > > >
> > > > ACK for migration
> > > >
> > > > Although I do worry that if you really have pmem hardware, is it better
> > > > to fail the migration if you don't have libpmem available?
> > >
> > > According to the PMDG man page, pmem_persist is supposed to be
> > > equivalent for the msync.
> >
> > OK, but you do define qemu_ram_block_writeback to fall back to fdatasync;
> > so that would be too little?
>
> Actually it shouldn't. All will end-up in vfs_fsync_range; msync will
> narrow the range.
> fdatasync will trigger the same call just that with a wider range. At
> least for Linux.
> fdatasync will also fallback to fsync if it is not available.
> So it's going from the best case scenario (as of performance and range of mem
> to be synced) towards the worst case one.
>
> I should probably double-check earlier versions of Linux.
> I'll also try to verify that for other host variants.
Well I guess it should probably follow whatever Posix says; it's OK to
make Linux specific assumptions for Linux specific bits - but you can't
do it by code examination to guarantee it'll be right for other
platforms, especially if this is in code ifdef'd for portability.
Also it needs commenting to explain why it's safe to avoid someone else
asking this question.
> BTW: Thank you for having a look at the changes.
No problem.
Dave
> BR
> Beata
>
> >
> > > It's just more performant. So in case of real pmem hardware it should
> > > be all good.
> > >
> > > [http://pmem.io/pmdk/manpages/linux/v1.2/libpmem.3.html]
> >
> > Dave
> >
> > >
> > > BR
> > > Beata
> > > >
> > > > Dave
> > > >
> > > > > }
> > > > >
> > > > > xbzrle_load_cleanup();
> > > > > --
> > > > > 2.17.1
> > > > >
> > > > --
> > > > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2019-09-11 10:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-10 9:56 [Qemu-devel] [PATCH 0/4] target/arm: Support for Data Cache Clean up to PoP Beata Michalska
2019-09-10 9:56 ` [Qemu-devel] [PATCH 1/4] tcg: cputlb: Add probe_read Beata Michalska
2019-09-23 23:54 ` Alex Bennée
2019-09-10 9:56 ` [Qemu-devel] [PATCH 2/4] Memory: Enable writeback for given memory region Beata Michalska
2019-09-24 0:00 ` Alex Bennée
2019-10-09 11:40 ` Beata Michalska
2019-09-24 16:28 ` Richard Henderson
2019-10-09 11:44 ` Beata Michalska
2019-09-24 16:30 ` Richard Henderson
2019-10-09 11:45 ` Beata Michalska
2019-09-10 9:56 ` [Qemu-devel] [PATCH 3/4] migration: ram: Switch to ram block writeback Beata Michalska
2019-09-10 10:26 ` Dr. David Alan Gilbert
2019-09-10 11:28 ` Beata Michalska
2019-09-10 13:16 ` Dr. David Alan Gilbert
2019-09-10 14:21 ` Beata Michalska
2019-09-11 10:36 ` Dr. David Alan Gilbert [this message]
2019-09-12 9:10 ` Beata Michalska
2019-09-24 16:30 ` Richard Henderson
2019-09-10 9:56 ` [Qemu-devel] [PATCH 4/4] target/arm: Add support for DC CVAP & DC CVADP ins Beata Michalska
2019-09-23 23:54 ` Alex Bennée
2019-10-09 11:47 ` Beata Michalska
2019-09-24 1:16 ` Alex Bennée
2019-10-09 11:49 ` Beata Michalska
2019-09-24 17:22 ` Richard Henderson
2019-10-09 11:53 ` Beata Michalska
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=20190911103645.GF2894@work-vm \
--to=dgilbert@redhat.com \
--cc=beata.michalska@linaro.org \
--cc=eric.auger@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=richard.henderson@linaro.org \
--cc=shameerali.kolothum.thodi@huawei.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).