All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, Manish Mishra <manish.mishra@nutanix.com>,
	Juan Quintela <quintela@redhat.com>,
	ani@anisinha.ca,
	Leonardo Bras Soares Passos <lsoaresp@redhat.com>,
	"Daniel P . Berrange" <berrange@redhat.com>
Subject: Re: [PATCH 13/14] migration: Remove old preempt code around state maintainance
Date: Thu, 6 Oct 2022 18:56:47 +0100	[thread overview]
Message-ID: <Yz8W38K9iyd1Uz8M@work-vm> (raw)
In-Reply-To: <YysXn4YwarhEvBC3@xz-m1.local>

For the set of 3:


Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

* Peter Xu (peterx@redhat.com) wrote:
> On Tue, Sep 20, 2022 at 08:47:20PM -0400, Peter Xu wrote:
> > On Tue, Sep 20, 2022 at 06:52:27PM -0400, Peter Xu wrote:
> > > With the new code to send pages in rp-return thread, there's little help to
> > > keep lots of the old code on maintaining the preempt state in migration
> > > thread, because the new way should always be faster..
> > > 
> > > Then if we'll always send pages in the rp-return thread anyway, we don't
> > > need those logic to maintain preempt state anymore because now we serialize
> > > things using the mutex directly instead of using those fields.
> > > 
> > > It's very unfortunate to have those code for a short period, but that's
> > > still one intermediate step that we noticed the next bottleneck on the
> > > migration thread.  Now what we can do best is to drop unnecessary code as
> > > long as the new code is stable to reduce the burden.  It's actually a good
> > > thing because the new "sending page in rp-return thread" model is (IMHO)
> > > even cleaner and with better performance.
> > > 
> > > Remove the old code that was responsible for maintaining preempt states, at
> > > the meantime also remove x-postcopy-preempt-break-huge parameter because
> > > with concurrent sender threads we don't really need to break-huge anymore.
> > > 
> > > Signed-off-by: Peter Xu <peterx@redhat.com>
> > > ---
> > >  migration/migration.c |   2 -
> > >  migration/ram.c       | 258 +-----------------------------------------
> > >  2 files changed, 3 insertions(+), 257 deletions(-)
> > > 
> > > diff --git a/migration/migration.c b/migration/migration.c
> > > index fae8fd378b..698fd94591 100644
> > > --- a/migration/migration.c
> > > +++ b/migration/migration.c
> > > @@ -4399,8 +4399,6 @@ static Property migration_properties[] = {
> > >      DEFINE_PROP_SIZE("announce-step", MigrationState,
> > >                        parameters.announce_step,
> > >                        DEFAULT_MIGRATE_ANNOUNCE_STEP),
> > > -    DEFINE_PROP_BOOL("x-postcopy-preempt-break-huge", MigrationState,
> > > -                      postcopy_preempt_break_huge, true),
> > 
> > Forgot to drop the variable altogether:
> > 
> > diff --git a/migration/migration.h b/migration/migration.h
> > index cdad8aceaa..ae4ffd3454 100644
> > --- a/migration/migration.h
> > +++ b/migration/migration.h
> > @@ -340,13 +340,6 @@ struct MigrationState {
> >      bool send_configuration;
> >      /* Whether we send section footer during migration */
> >      bool send_section_footer;
> > -    /*
> > -     * Whether we allow break sending huge pages when postcopy preempt is
> > -     * enabled.  When disabled, we won't interrupt precopy within sending a
> > -     * host huge page, which is the old behavior of vanilla postcopy.
> > -     * NOTE: this parameter is ignored if postcopy preempt is not enabled.
> > -     */
> > -    bool postcopy_preempt_break_huge;
> >  
> >      /* Needed by postcopy-pause state */
> >      QemuSemaphore postcopy_pause_sem;
> > 
> > Will squash this in in next version.
> 
> Two more varialbes to drop, as attached..
> 
> 
> -- 
> Peter Xu

> From b3308e34398e21c19bd36ec21aae9c7f9f623d75 Mon Sep 17 00:00:00 2001
> From: Peter Xu <peterx@redhat.com>
> Date: Wed, 21 Sep 2022 09:51:55 -0400
> Subject: [PATCH] fixup! migration: Remove old preempt code around state
>  maintainance
> Content-type: text/plain
> 
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  migration/ram.c | 33 ---------------------------------
>  1 file changed, 33 deletions(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 03bf2324ab..2599eee070 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -97,28 +97,6 @@ struct PageSearchStatus {
>      unsigned long page;
>      /* Set once we wrap around */
>      bool         complete_round;
> -    /*
> -     * [POSTCOPY-ONLY] Whether current page is explicitly requested by
> -     * postcopy.  When set, the request is "urgent" because the dest QEMU
> -     * threads are waiting for us.
> -     */
> -    bool         postcopy_requested;
> -    /*
> -     * [POSTCOPY-ONLY] The target channel to use to send current page.
> -     *
> -     * Note: This may _not_ match with the value in postcopy_requested
> -     * above. Let's imagine the case where the postcopy request is exactly
> -     * the page that we're sending in progress during precopy. In this case
> -     * we'll have postcopy_requested set to true but the target channel
> -     * will be the precopy channel (so that we don't split brain on that
> -     * specific page since the precopy channel already contains partial of
> -     * that page data).
> -     *
> -     * Besides that specific use case, postcopy_target_channel should
> -     * always be equal to postcopy_requested, because by default we send
> -     * postcopy pages via postcopy preempt channel.
> -     */
> -    bool         postcopy_target_channel;
>      /* Whether we're sending a host page */
>      bool          host_page_sending;
>      /* The start/end of current host page.  Invalid if host_page_sending==false */
> @@ -1573,13 +1551,6 @@ retry:
>   */
>  static bool find_dirty_block(RAMState *rs, PageSearchStatus *pss, bool *again)
>  {
> -    /*
> -     * This is not a postcopy requested page, mark it "not urgent", and use
> -     * precopy channel to send it.
> -     */
> -    pss->postcopy_requested = false;
> -    pss->postcopy_target_channel = RAM_CHANNEL_PRECOPY;
> -
>      /* Update pss->page for the next dirty bit in ramblock */
>      pss_find_next_dirty(pss);
>  
> @@ -2091,9 +2062,6 @@ static bool get_queued_page(RAMState *rs, PageSearchStatus *pss)
>           * really rare.
>           */
>          pss->complete_round = false;
> -        /* Mark it an urgent request, meanwhile using POSTCOPY channel */
> -        pss->postcopy_requested = true;
> -        pss->postcopy_target_channel = RAM_CHANNEL_POSTCOPY;
>      }
>  
>      return !!block;
> @@ -2190,7 +2158,6 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len)
>           * we should be the only one who operates on the qemufile
>           */
>          pss->pss_channel = migrate_get_current()->postcopy_qemufile_src;
> -        pss->postcopy_requested = true;
>          assert(pss->pss_channel);
>  
>          /*
> -- 
> 2.32.0
> 

-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



  reply	other threads:[~2022-10-06 18:29 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20 22:50 [PATCH 00/14] migration: Postcopy Preempt-Full Peter Xu
2022-09-20 22:50 ` [PATCH 01/14] migration: Add postcopy_preempt_active() Peter Xu
2022-09-20 22:50 ` [PATCH 02/14] migration: Cleanup xbzrle zero page cache update logic Peter Xu
2022-10-04 10:33   ` Dr. David Alan Gilbert
2022-09-20 22:50 ` [PATCH 03/14] migration: Trivial cleanup save_page_header() on same block check Peter Xu
2022-10-04 10:41   ` Dr. David Alan Gilbert
2022-09-20 22:50 ` [PATCH 04/14] migration: Remove RAMState.f references in compression code Peter Xu
2022-10-04 10:54   ` Dr. David Alan Gilbert
2022-10-04 14:36     ` Peter Xu
2022-09-20 22:52 ` [PATCH 05/14] migration: Yield bitmap_mutex properly when sending/sleeping Peter Xu
2022-10-04 13:55   ` Dr. David Alan Gilbert
2022-10-04 19:13     ` Peter Xu
2022-10-05 11:18       ` Dr. David Alan Gilbert
2022-10-05 13:40         ` Peter Xu
2022-10-05 19:48           ` Peter Xu
2022-09-20 22:52 ` [PATCH 06/14] migration: Use atomic ops properly for page accountings Peter Xu
2022-10-04 16:59   ` Dr. David Alan Gilbert
2022-10-04 19:23     ` Peter Xu
2022-10-05 11:38       ` Dr. David Alan Gilbert
2022-10-05 13:53         ` Peter Xu
2022-10-06 20:40           ` Peter Xu
2022-09-20 22:52 ` [PATCH 07/14] migration: Teach PSS about host page Peter Xu
2022-10-05 11:12   ` Dr. David Alan Gilbert
2022-09-20 22:52 ` [PATCH 08/14] migration: Introduce pss_channel Peter Xu
2022-10-05 13:03   ` Dr. David Alan Gilbert
2022-09-20 22:52 ` [PATCH 09/14] migration: Add pss_init() Peter Xu
2022-10-05 13:09   ` Dr. David Alan Gilbert
2022-09-20 22:52 ` [PATCH 10/14] migration: Make PageSearchStatus part of RAMState Peter Xu
2022-10-05 18:51   ` Dr. David Alan Gilbert
2022-10-05 19:41     ` Peter Xu
2022-10-06  8:36       ` Dr. David Alan Gilbert
2022-10-06  8:37   ` Dr. David Alan Gilbert
2022-09-20 22:52 ` [PATCH 11/14] migration: Move last_sent_block into PageSearchStatus Peter Xu
2022-10-06 16:59   ` Dr. David Alan Gilbert
2022-10-06 18:34     ` Peter Xu
2022-10-06 18:38       ` Dr. David Alan Gilbert
2022-09-20 22:52 ` [PATCH 12/14] migration: Send requested page directly in rp-return thread Peter Xu
2022-10-06 17:51   ` Dr. David Alan Gilbert
2022-09-20 22:52 ` [PATCH 13/14] migration: Remove old preempt code around state maintainance Peter Xu
2022-09-21  0:47   ` Peter Xu
2022-09-21 13:54     ` Peter Xu
2022-10-06 17:56       ` Dr. David Alan Gilbert [this message]
2022-09-20 22:52 ` [PATCH 14/14] migration: Drop rs->f Peter Xu
2022-10-06 17:57   ` 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=Yz8W38K9iyd1Uz8M@work-vm \
    --to=dgilbert@redhat.com \
    --cc=ani@anisinha.ca \
    --cc=berrange@redhat.com \
    --cc=lsoaresp@redhat.com \
    --cc=manish.mishra@nutanix.com \
    --cc=peterx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.