qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/1] Count used RAMBlock pages for migration_dirty_pages
Date: Fri, 21 Mar 2014 15:45:41 +0000	[thread overview]
Message-ID: <20140321154540.GD8476@work-vm> (raw)
In-Reply-To: <532C57A9.2060002@redhat.com>

* Paolo Bonzini (pbonzini@redhat.com) wrote:
> Il 21/03/2014 14:22, Dr. David Alan Gilbert ha scritto:
> >I don't think they overlap, but I worry that the end of one block
> >and the start of the next might be on the same page.
> >The code that got me worried was migration_bitmap_sync_range
> >that seemd to be general; but actually that's worrying about 64bit words
> >not pages.
> >What happens with things like '/rom@etc/table-loader' which is only
> >4k on x86 when they are on boxes with bigger target_page.
> 
> Do you mean bigger host page?

Yes.

> RAM sizes are always rounded up to target page size:
> 
>     size = TARGET_PAGE_ALIGN(size);
> 
> If I understand correctly all that matters here is ram addresses
> have no remainder WRT target page sizes.

OK, so I can simplify it back to last nights code from before
I started worrying about it.

> Host page sizes matter only for KVM (see hpratio in
> cpu_physical_memory_set_dirty_lebitmap in include/exec/ram_addr.h).
> In this case dirtying a 4K area also dirties 12K of adjacent
> ram_addr_t. Things could go wrong if those ram_addr_t's are not part
> of any RAMBlock, because in that case you will loop endlessly (I
> think).  But this is not something your patch introduces.

No, actually I don't think it will loop; the code loops over all the
RAM blocks, looking only at the bitmap bits that RAMBlocks->length
cover; if the kernel sets bits outside the RAMBlocks then they'll
get ignored.

> So it looks like your patch could also fix the problem Juan reported
> at http://article.gmane.org/gmane.comp.emulators.qemu/247462 -- but
> perhaps only on hosts where !KVM || TARGET_PAGE_SIZE==getpagesize().

Possibly yes; I think that would cause gaps in the bitmap to have
the same effect as the hot unplug.

I'll rework the patch to my less paranoid version from yesterday
that treats bitmap bits as belonging to only one RAMBlock and repost.

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

  reply	other threads:[~2014-03-21 15:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 10:58 [Qemu-devel] [PATCH 1/1] Count used RAMBlock pages for migration_dirty_pages Dr. David Alan Gilbert (git)
2014-03-21 13:11 ` Juan Quintela
2014-03-21 13:22   ` Dr. David Alan Gilbert
2014-03-21 15:15     ` Paolo Bonzini
2014-03-21 15:45       ` Dr. David Alan Gilbert [this message]
2014-03-21 15:49         ` Paolo Bonzini
2014-03-21 16:08           ` Juan Quintela
2014-03-21 13:44 ` 陈梁
2014-03-21 14:41   ` 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=20140321154540.GD8476@work-vm \
    --to=dgilbert@redhat.com \
    --cc=aik@ozlabs.ru \
    --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).