qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Prasad Pandit <ppandit@redhat.com>
Cc: peterx@redhat.com, qemu-devel@nongnu.org,
	Fabiano Rosas <farosas@suse.de>
Subject: Re: [PATCH] migration/multifd: Document two places for mapped-ram
Date: Fri, 1 Mar 2024 17:50:24 +0000	[thread overview]
Message-ID: <ZeIVYDnAkPTpKHsP@redhat.com> (raw)
In-Reply-To: <CAE8KmOz_5-DtSO2BHpBXgD2kJUjwsLaqKguOcWgfXC2efB2rWA@mail.gmail.com>

On Fri, Mar 01, 2024 at 11:17:10PM +0530, Prasad Pandit wrote:
> Hello Petr,
> 
> On Fri, 1 Mar 2024 at 14:46, <peterx@redhat.com> wrote:
> > +         * An explicitly close() on the channel here is normally not
> 
> explicitly -> explicit
> 
> > +         * required, but can be helpful for "file:" iochannels, where it
> > +         * will include an fdatasync() to make sure the data is flushed to
> > +         * the disk backend.
> 
> * an fdatasync() -> fdatasync()
> 
> * qio_channel_close
>     -> ioc_klass->io_close = qio_channel_file_close;
>      -> qemu_close(fioc->fd)
>       -> close(fd);
> 
> It does not seem to call fdatasync() before close(fd);
> 
>     - qio_channel_file_new_path(filename, O_CREAT | O_WRONLY | O_TRUNC, ...)

The documented behaviour reliant on another pending patch:

https://lists.nongnu.org/archive/html/qemu-devel/2024-02/msg07046.html

> 
> Maybe the qio_channel..() calls above should include the 'O_DSYNC'
> flag as well? But that will do fdatasync() work at each write(2) call
> I think, not sure if that is okay.



> 
> > +         *
> > +         * The object_unref() cannot guarantee that because: (1) finalize()
> > +         * of the iochannel is only triggered on the last reference, and
> > +         * it's not guaranteed that we always hold the last refcount when
> > +         * reaching here, and, (2) even if finalize() is invoked, it only
> > +         * does a close(fd) without data flush.
> > +         */
> 
> * object_unref
>     -> object_finalize
>       -> object_deinit
>         -> type->instance_finalize
>          -> qio_channel_file_finalize
>           -> qemu_close(ioc->fd);
> 
> * I hope I'm looking at the right code here. (Sorry if I'm not)

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2024-03-01 17:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  9:15 [PATCH] migration/multifd: Document two places for mapped-ram peterx
2024-03-01 12:22 ` Fabiano Rosas
2024-03-01 17:47 ` Prasad Pandit
2024-03-01 17:50   ` Daniel P. Berrangé [this message]
2024-03-04  0:30     ` Peter Xu
2024-03-04  5:21       ` Prasad Pandit

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=ZeIVYDnAkPTpKHsP@redhat.com \
    --to=berrange@redhat.com \
    --cc=farosas@suse.de \
    --cc=peterx@redhat.com \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).