diff mbox

[v4,38/47] Add assertion to check migration_dirty_pages

Message ID 1412358473-31398-39-git-send-email-dgilbert@redhat.com
State New
Headers show

Commit Message

Dr. David Alan Gilbert Oct. 3, 2014, 5:47 p.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

I've seen it go negative once during dev, it shouldn't
happen.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 arch_init.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Paolo Bonzini Oct. 4, 2014, 6:32 p.m. UTC | #1
Il 03/10/2014 19:47, Dr. David Alan Gilbert (git) ha scritto:
> 
> I've seen it go negative once during dev, it shouldn't
> happen.

You can move it earlier, perhaps even as patch 1, since it does not have
any dependency on postcopy and can go in at any time.

Paolo
Dr. David Alan Gilbert Oct. 6, 2014, 6:51 p.m. UTC | #2
* Paolo Bonzini (pbonzini@redhat.com) wrote:
> Il 03/10/2014 19:47, Dr. David Alan Gilbert (git) ha scritto:
> > 
> > I've seen it go negative once during dev, it shouldn't
> > happen.
> 
> You can move it earlier, perhaps even as patch 1, since it does not have
> any dependency on postcopy and can go in at any time.

OK, I moved it to the 2nd patch - just after the docs (Eric previously said
he liked those at the start of a patch set).

Dave

> 
> Paolo
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Paolo Bonzini Oct. 6, 2014, 8:30 p.m. UTC | #3
Il 06/10/2014 20:51, Dr. David Alan Gilbert ha scritto:
> * Paolo Bonzini (pbonzini@redhat.com) wrote:
>> Il 03/10/2014 19:47, Dr. David Alan Gilbert (git) ha scritto:
>>>
>>> I've seen it go negative once during dev, it shouldn't
>>> happen.
>>
>> You can move it earlier, perhaps even as patch 1, since it does not have
>> any dependency on postcopy and can go in at any time.
> 
> OK, I moved it to the 2nd patch - just after the docs (Eric previously said
> he liked those at the start of a patch set).

What about sending it for 2.2?  Might as well package it up with Peter's
flags patch and send a pull request, since Juan is busy and has hardly
written to the list for several months now.

Paolo
David Gibson Nov. 11, 2014, 1:14 a.m. UTC | #4
On Fri, Oct 03, 2014 at 06:47:44PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> I've seen it go negative once during dev, it shouldn't
> happen.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
diff mbox

Patch

diff --git a/arch_init.c b/arch_init.c
index a945990..2f4345a 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -442,6 +442,7 @@  ram_addr_t migration_bitmap_find_and_reset_dirty(MemoryRegion *mr,
 
     if (next < size) {
         clear_bit(next, migration_bitmap);
+        assert(migration_dirty_pages > 0);
         migration_dirty_pages--;
     }
     *bitoffset = next;