From: Peter Xu <peterx@redhat.com>
To: Andrey Gruzdev <andrey.gruzdev@virtuozzo.com>
Cc: Juan Quintela <quintela@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>, Den Lunev <den@openvz.org>
Subject: Re: [PATCH v4 2/6] introduce UFFD-WP low-level interface helpers
Date: Mon, 30 Nov 2020 10:34:19 -0500 [thread overview]
Message-ID: <20201130153419.GA3277@xz-x1> (raw)
In-Reply-To: <bfd5afe2-3c4c-8c5b-a984-5c8bdc502a33@virtuozzo.com>
On Sun, Nov 29, 2020 at 11:12:10PM +0300, Andrey Gruzdev wrote:
> > > +void ram_write_tracking_stop(void)
> > > +{
> > > +#ifdef CONFIG_LINUX
> > > + RAMState *rs = ram_state;
> > > + RAMBlock *bs;
> > > + assert(rs->uffdio_fd >= 0);
> >
> > Maybe too harsh - we can return if it's invalid.
> >
> > Meanwhile, better rcu_read_lock(), as well?
> >
>
> Yep, RCU lock, I'll add. Why too harsh? Just a debug assertion.
I was afraid some special path could trigger ram_write_tracking_stop() being
called before ram_write_tracking_start(), then vm could crash. If we can
guarantee that not happening, then it's also ok with assert().
[...]
> > > +/**
> > > + * uffd_poll_events: poll UFFD file descriptor for read
> > > + *
> > > + * Returns true if events are available for read, false otherwise
> > > + *
> > > + * @uffd: UFFD file descriptor
> > > + * @tmo: timeout in milliseconds, 0 for non-blocking operation,
> > > + * negative value for infinite wait
> > > + */
> > > +bool uffd_poll_events(int uffd, int tmo)
> >
> > Shall we spell "tmo" out?
> In the comment? I think it's ok.
I'd suggest to spell it out everywhere, especially in the codes. But feel free
to take your own preference. Thanks,
--
Peter Xu
next prev parent reply other threads:[~2020-11-30 15:35 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-26 15:17 [PATCH v4 0/6] UFFD write-tracking migration/snapshots Andrey Gruzdev via
2020-11-26 15:17 ` [PATCH v4 1/6] introduce 'background-snapshot' migration capability Andrey Gruzdev via
2020-11-27 19:55 ` Peter Xu
2020-11-28 16:35 ` Andrey Gruzdev
2020-11-26 15:17 ` [PATCH v4 2/6] introduce UFFD-WP low-level interface helpers Andrey Gruzdev via
2020-11-27 21:04 ` Peter Xu
2020-11-29 20:12 ` Andrey Gruzdev
2020-11-30 15:34 ` Peter Xu [this message]
2020-11-30 18:41 ` Andrey Gruzdev
2020-12-01 12:24 ` Dr. David Alan Gilbert
2020-12-01 19:32 ` Andrey Gruzdev
2020-11-26 15:17 ` [PATCH v4 3/6] support UFFD write fault processing in ram_save_iterate() Andrey Gruzdev via
2020-11-27 21:49 ` Peter Xu
2020-11-29 21:14 ` Andrey Gruzdev
2020-11-30 16:32 ` Peter Xu
2020-11-30 19:27 ` Andrey Gruzdev
2020-11-26 15:17 ` [PATCH v4 4/6] implementation of background snapshot thread Andrey Gruzdev via
2020-11-26 15:17 ` [PATCH v4 5/6] the rest of write tracking migration code Andrey Gruzdev via
2020-11-27 22:26 ` Peter Xu
2020-11-30 8:09 ` Andrey Gruzdev
2020-11-26 15:17 ` [PATCH v4 6/6] introduce simple linear scan rate limiting mechanism Andrey Gruzdev via
2020-11-27 22:28 ` Peter Xu
2020-11-30 8:11 ` Andrey Gruzdev
2020-11-30 16:40 ` Peter Xu
2020-11-30 19:30 ` Andrey Gruzdev
2020-11-26 15:47 ` [PATCH v4 0/6] UFFD write-tracking migration/snapshots Peter Krempa
2020-11-27 8:21 ` Andrey Gruzdev
2020-11-27 9:49 ` Peter Krempa
2020-11-27 10:00 ` Andrey Gruzdev
2020-11-27 15:45 ` Peter Xu
2020-11-27 17:19 ` Andrey Gruzdev
2020-11-27 22:04 ` Peter Xu
2020-11-30 8:07 ` Andrey Gruzdev
2020-12-01 7:08 ` Peter Krempa
2020-12-01 8:42 ` Andrey Gruzdev
2020-12-01 10:53 ` Peter Krempa
2020-12-01 11:24 ` Andrey Gruzdev
2020-12-01 18:40 ` Dr. David Alan Gilbert
2020-12-01 19:22 ` Peter Xu
2020-12-01 20:01 ` Dr. David Alan Gilbert
2020-12-01 20:29 ` Andrey Gruzdev
2020-12-01 20:11 ` Andrey Gruzdev
2020-12-01 18:54 ` Peter Xu
2020-12-01 20:00 ` Dr. David Alan Gilbert
2020-12-01 20:26 ` Andrey Gruzdev
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=20201130153419.GA3277@xz-x1 \
--to=peterx@redhat.com \
--cc=andrey.gruzdev@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=dgilbert@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.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).