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 v3 3/7] support UFFD write fault processing in ram_save_iterate()
Date: Mon, 23 Nov 2020 16:34:43 -0500 [thread overview]
Message-ID: <20201123213443.GE60522@xz-x1> (raw)
In-Reply-To: <c222b7ca-9368-3adc-00fd-5261216f7df1@virtuozzo.com>
On Fri, Nov 20, 2020 at 07:53:34PM +0300, Andrey Gruzdev wrote:
> On 20.11.2020 19:43, Peter Xu wrote:
> > On Fri, Nov 20, 2020 at 07:15:07PM +0300, Andrey Gruzdev wrote:
> > > Yeah, I think we can re-use the postcopy queue code for faulting pages. I'm
> > > worring a little about some additional overhead dealing with urgent request
> > > semaphore. Also, the code won't change a lot, something like:
> > >
> > > [...]
> > > /* In case of 'write-tracking' migration we first try
> > > * to poll UFFD and sse if we have write page fault event */
> > > poll_fault_page(rs);
> > >
> > > again = true;
> > > found = get_queued_page(rs, &pss);
> > >
> > > if (!found) {
> > > /* priority queue empty, so just search for something dirty */
> > > found = find_dirty_block(rs, &pss, &again);
> > > }
> > > [...]
> >
> > Could I ask what's the "urgent request semaphore"? Thanks,
> >
>
> These function use it (the correct name is 'rate_limit_sem'):
>
> void migration_make_urgent_request(void)
> {
> qemu_sem_post(&migrate_get_current()->rate_limit_sem);
> }
>
> void migration_consume_urgent_request(void)
> {
> qemu_sem_wait(&migrate_get_current()->rate_limit_sem);
> }
>
> They are called from ram_save_queue_pages and unqueue_page, accordingly, to
> control migration rate limiter.
>
> bool migration_rate_limit(void)
> {
> [...]
> /*
> * Wait for a delay to do rate limiting OR
> * something urgent to post the semaphore.
> */
> int ms = s->iteration_start_time + BUFFER_DELAY - now;
> trace_migration_rate_limit_pre(ms);
> if (qemu_sem_timedwait(&s->rate_limit_sem, ms) == 0) {
> /*
> * We were woken by one or more urgent things but
> * the timedwait will have consumed one of them.
> * The service routine for the urgent wake will dec
> * the semaphore itself for each item it consumes,
> * so add this one we just eat back.
> */
> qemu_sem_post(&s->rate_limit_sem);
> urgent = true;
> }
> [...]
> }
>
Hmm... Why its overhead could be a problem? If it's an overhead that can be
avoided, then postcopy might want that too.
The thing is I really feel like the snapshot logic can leverage the whole idea
of existing postcopy (like get_queued_page/unqueue_page; it's probably due to
the fact that both of them want to "migrate some more urgent pages than the
background migration, due to either missing/wrprotected pages"), but I might
have something missing.
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2020-11-23 21:36 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-19 12:59 [PATCH v3 0/7] UFFD write-tracking migration/snapshots Andrey Gruzdev via
2020-11-19 12:59 ` [PATCH v3 1/7] introduce 'track-writes-ram' migration capability Andrey Gruzdev via
2020-11-19 18:51 ` Peter Xu
2020-11-19 19:07 ` Peter Xu
2020-11-20 11:35 ` Andrey Gruzdev
2020-11-24 16:55 ` Dr. David Alan Gilbert
2020-11-24 17:25 ` Andrey Gruzdev
2020-11-20 11:32 ` Andrey Gruzdev
2020-11-19 12:59 ` [PATCH v3 2/7] introduce UFFD-WP low-level interface helpers Andrey Gruzdev via
2020-11-19 18:39 ` Peter Xu
2020-11-20 11:04 ` Andrey Gruzdev
2020-11-20 15:01 ` Peter Xu
2020-11-20 15:43 ` Andrey Gruzdev
2020-11-24 17:57 ` Dr. David Alan Gilbert
2020-11-25 8:11 ` Andrey Gruzdev
2020-11-25 18:43 ` Dr. David Alan Gilbert
2020-11-25 19:17 ` Andrey Gruzdev
2020-11-19 12:59 ` [PATCH v3 3/7] support UFFD write fault processing in ram_save_iterate() Andrey Gruzdev via
2020-11-19 18:25 ` Peter Xu
2020-11-20 10:44 ` Andrey Gruzdev
2020-11-20 15:07 ` Peter Xu
2020-11-20 16:15 ` Andrey Gruzdev
2020-11-20 16:43 ` Peter Xu
2020-11-20 16:53 ` Andrey Gruzdev
2020-11-23 21:34 ` Peter Xu [this message]
2020-11-24 8:02 ` Andrey Gruzdev
2020-11-24 15:17 ` Peter Xu
2020-11-24 17:40 ` Andrey Gruzdev
2020-11-25 13:08 ` Dr. David Alan Gilbert
2020-11-25 14:40 ` Andrey Gruzdev
2020-11-25 18:41 ` Dr. David Alan Gilbert
2020-11-25 19:12 ` Andrey Gruzdev
2020-11-19 12:59 ` [PATCH v3 4/7] implementation of write-tracking migration thread Andrey Gruzdev via
2020-11-19 18:47 ` Peter Xu
2020-11-20 11:41 ` Andrey Gruzdev
2020-11-19 12:59 ` [PATCH v3 5/7] implementation of vm_start() BH Andrey Gruzdev via
2020-11-19 18:46 ` Peter Xu
2020-11-20 11:13 ` Andrey Gruzdev
2020-11-19 12:59 ` [PATCH v3 6/7] the rest of write tracking migration code Andrey Gruzdev via
2020-11-19 12:59 ` [PATCH v3 7/7] introduce simple linear scan rate limiting mechanism Andrey Gruzdev via
2020-11-19 20:02 ` Peter Xu
2020-11-20 12:06 ` Andrey Gruzdev
2020-11-20 15:23 ` Peter Xu
2020-11-24 16:41 ` [PATCH v3 0/7] UFFD write-tracking migration/snapshots Dr. David Alan Gilbert
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=20201123213443.GE60522@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).