From nobody Mon Feb 9 02:38:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636445229103837.5237346846891; Tue, 9 Nov 2021 00:07:09 -0800 (PST) Received: from localhost ([::1]:46466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkM9r-0005Qz-Tt for importer@patchew.org; Tue, 09 Nov 2021 03:07:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkM5r-0007nT-9h for qemu-devel@nongnu.org; Tue, 09 Nov 2021 03:02:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:59017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkM5o-0002Ad-4X for qemu-devel@nongnu.org; Tue, 09 Nov 2021 03:02:58 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-430-Y5CWEFJ5OWy4HcxbyrIDzQ-1; Tue, 09 Nov 2021 03:02:53 -0500 Received: by mail-wm1-f69.google.com with SMTP id 144-20020a1c0496000000b003305ac0e03aso916006wme.8 for ; Tue, 09 Nov 2021 00:02:53 -0800 (PST) Received: from localhost (static-233-86-86-188.ipcom.comunitel.net. [188.86.86.233]) by smtp.gmail.com with ESMTPSA id h13sm19634099wrx.82.2021.11.09.00.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 00:02:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636444974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pD7YLrllgP6VLzqydyv0t3IiBKdwZIuauKQIRAu02NU=; b=VS3frv4TXAfiTGScScC2dEJQWYkfWFFYMoiCHX3npuco6lkte7hSDjn1oeryYN0Wj6IACN fwRCfCoX7duAps9/CZnnaBi+xq1Yp0ZkzgdpMu3B3edXjPAzY0BOou9B8l5mH67qEBuIwJ tBKdnPZnVhwX3j5eRgXXRlFIY/2St/o= X-MC-Unique: Y5CWEFJ5OWy4HcxbyrIDzQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pD7YLrllgP6VLzqydyv0t3IiBKdwZIuauKQIRAu02NU=; b=S4Bz0Qs0oJAuZoG2ZMOPAljfN6W1HPGuZSCcJNYMzlSPNYLXHAobm9dWFOmhaXkJ2l 93vN0C5MBeC2xTM8n5F7nFJCDQURs1CGZcM9kovjyHfEq2Jw/CJJQFHmzqt2pnZWx54s TgaiNS7hnMC6myQvkISb1Dwj+8i+nxJ5sa6WCn19PSaUfsGa4YslP9wvW7xhcHdiXzHW FQoswD4JkNz2W0V+7VGlS5JMseXoXPLlmb5hDqQeNkO1mMy9f0ghwA+qQiyluSshEa0A vPT/CF2uxllitOrBH1t2VjCnxchsQeUtOgJy4Esfoh7FZqgn1DU0vwfCr8iqPqai/w2O d4pA== X-Gm-Message-State: AOAM531ijnbUE3iJjFxcHwcaTnoQV/I7XdzcWlmZM52+87MaUceNn0RY bDwGJMrHNgu6DSsVxlI92G60kF90JfPXOJys6QhW73eGUsnwEeki9aKvyZ/qZwtASDOFCoppXXO edYp1+7cNp8uwxtuNQ071a/D/S9NA12apVnrWcn0GWnCzFAbsMaUEnjqf021DtyjZINM= X-Received: by 2002:a7b:cc8f:: with SMTP id p15mr5058789wma.129.1636444972309; Tue, 09 Nov 2021 00:02:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzco07ZPBLwRGpxXbcidN7nUclkeHMCLM7S1WzzppBeZxJlEIMVt8JpdKYnw5d6l4tWVU+KIA== X-Received: by 2002:a7b:cc8f:: with SMTP id p15mr5058754wma.129.1636444972068; Tue, 09 Nov 2021 00:02:52 -0800 (PST) From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 1/3] docs: fix 'sample-pages' option tag Date: Tue, 9 Nov 2021 09:02:45 +0100 Message-Id: <20211109080247.62559-2-quintela@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211109080247.62559-1-quintela@redhat.com> References: <20211109080247.62559-1-quintela@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=quintela@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.699, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hailiang Zhang , Juan Quintela , =?UTF-8?q?Hyman=20Huang=28=E9=BB=84=E5=8B=87=29?= , Markus Armbruster , "Dr. David Alan Gilbert" , Eric Blake Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636445230226100003 From: Hyman Huang(=E9=BB=84=E5=8B=87) commit f78d4ed701 has fixed qemu tag, making 'sample-pages' option tag involved by accident, which introduced since 6.1 in commit 7afa08cd8fd. revert this line. Signed-off-by: Hyman Huang(=E9=BB=84=E5=8B=87) Reviewed-by: Markus Armbruster Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- qapi/migration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/migration.json b/qapi/migration.json index f0aefdab64..bbfd48cf0b 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1796,7 +1796,7 @@ # @calc-time: time in units of second for sample dirty pages # # @sample-pages: page count per GB for sample dirty pages -# the default value is 512 (since 6.2) +# the default value is 512 (since 6.1) # # @mode: mode containing method of calculate dirtyrate includes # 'page-sampling' and 'dirty-ring' (Since 6.2) --=20 2.33.1 From nobody Mon Feb 9 02:38:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16364450908551006.1254280648319; Tue, 9 Nov 2021 00:04:50 -0800 (PST) Received: from localhost ([::1]:40424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkM7c-0001Md-K7 for importer@patchew.org; Tue, 09 Nov 2021 03:04:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkM5r-0007oT-5A for qemu-devel@nongnu.org; Tue, 09 Nov 2021 03:02:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkM5o-0002Ao-Cq for qemu-devel@nongnu.org; Tue, 09 Nov 2021 03:02:58 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-ze7d5rmfNDmIFFfGdWiCGw-1; Tue, 09 Nov 2021 03:02:55 -0500 Received: by mail-wr1-f70.google.com with SMTP id q7-20020adff507000000b0017d160d35a8so4621366wro.4 for ; Tue, 09 Nov 2021 00:02:54 -0800 (PST) Received: from localhost (static-233-86-86-188.ipcom.comunitel.net. [188.86.86.233]) by smtp.gmail.com with ESMTPSA id a22sm1653443wme.19.2021.11.09.00.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 00:02:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636444975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P/6Qi49GjgS9oa+N7U8Dbq9g7j3/fB7gPw5LowLrOPE=; b=WSse4D7aYZqGrSbTC1IQLTkmGEh9kdQ8eUpKcXRamFYoQ83/gZX0G8/sT/6kDOuEJ84CBD 7VNCoJXY4Hu2kUuHhbT5lu0X0p4NO+fodxe0HUGEjCRErdeynEAuQSgoOD3EcJZGs70qsT 0NaOPIUGa1OyD0gE75pecTtLqVJ0kRI= X-MC-Unique: ze7d5rmfNDmIFFfGdWiCGw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P/6Qi49GjgS9oa+N7U8Dbq9g7j3/fB7gPw5LowLrOPE=; b=dA2haXLbnhi/sDoh9XkwcWZ6ThKr0WvKmNaiH+jS68YVEXTMYp5gVE6duD+lQNe6fm o0Xl+e5cMVu+N+BIUXNQGuupRJzBsGIK8Zzzzaa9WMtn6Lj1cB3eOCMf7tIrABJH3svI L0pyc3OmAU5m7u0pCoiWY7xK1BTUO+K/yyrSPQbvXKADV2iG1y0bIhX5ObZE3j1sxFh+ 4bPEh5SQWyVCRcWB4+E17uFUpIxlsBjYepzLaAG4rQMyuv/TNRbAIZre+xho+yc6KMvL giIRo3XFSMtek4GOR4QkxgLVw1u2DeP29DdPuTY7eXoP0QYudJHYVJXEH3VRNzJKEEzf ytlg== X-Gm-Message-State: AOAM533dgtj4jhJNN1hfGKB+EcW5VCQ1dDej2fRhmzmTRfmOhH8gbU70 aTmg3T4qjOubUiWteLsc3wZ5yC9MoI2yDvNUf8shJZHPDRPL2RKW/P0rgiGM6dZXHJ+rmCQblza 51Rp1Sa2h8VGWI/nvPsw8SzhoXH2HrK8UVKFdtz0lVmlcNs8VIEXSFCWtaxbs94lOrvs= X-Received: by 2002:a05:600c:6016:: with SMTP id az22mr4248434wmb.11.1636444973527; Tue, 09 Nov 2021 00:02:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyr4td6ClbyoVYe/SVAZmPtPzP+oT8fNU7OSnt/CevkB4/bsHBKxjM1jLHdcbddUFF6DWNBBA== X-Received: by 2002:a05:600c:6016:: with SMTP id az22mr4248400wmb.11.1636444973228; Tue, 09 Nov 2021 00:02:53 -0800 (PST) From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 2/3] Reduce the PVM stop time during Checkpoint Date: Tue, 9 Nov 2021 09:02:46 +0100 Message-Id: <20211109080247.62559-3-quintela@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211109080247.62559-1-quintela@redhat.com> References: <20211109080247.62559-1-quintela@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=quintela@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.699, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lukas Straub , Hailiang Zhang , Juan Quintela , "Rao, Lei" , Markus Armbruster , "Dr. David Alan Gilbert" , Eric Blake Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636445092320100001 Content-Type: text/plain; charset="utf-8" From: "Rao, Lei" When flushing memory from ram cache to ram during every checkpoint on secondary VM, we can copy continuous chunks of memory instead of 4096 bytes per time to reduce the time of VM stop during checkpoint. Signed-off-by: Lei Rao Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Lukas Straub Reviewed-by: Juan Quintela Tested-by: Lukas Straub Signed-off-by: Juan Quintela --- migration/ram.c | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 847af461f2..f48cf4b0a5 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -836,6 +836,41 @@ migration_clear_memory_region_dirty_bitmap_range(RAMBl= ock *rb, } } =20 +/* + * colo_bitmap_find_diry:find contiguous dirty pages from start + * + * Returns the page offset within memory region of the start of the contig= uout + * dirty page + * + * @rs: current RAM state + * @rb: RAMBlock where to search for dirty pages + * @start: page where we start the search + * @num: the number of contiguous dirty pages + */ +static inline +unsigned long colo_bitmap_find_dirty(RAMState *rs, RAMBlock *rb, + unsigned long start, unsigned long *n= um) +{ + unsigned long size =3D rb->used_length >> TARGET_PAGE_BITS; + unsigned long *bitmap =3D rb->bmap; + unsigned long first, next; + + *num =3D 0; + + if (ramblock_is_ignored(rb)) { + return size; + } + + first =3D find_next_bit(bitmap, size, start); + if (first >=3D size) { + return first; + } + next =3D find_next_zero_bit(bitmap, size, first + 1); + assert(next >=3D first); + *num =3D next - first; + return first; +} + static inline bool migration_bitmap_clear_dirty(RAMState *rs, RAMBlock *rb, unsigned long page) @@ -3886,19 +3921,26 @@ void colo_flush_ram_cache(void) block =3D QLIST_FIRST_RCU(&ram_list.blocks); =20 while (block) { - offset =3D migration_bitmap_find_dirty(ram_state, block, offse= t); + unsigned long num =3D 0; =20 + offset =3D colo_bitmap_find_dirty(ram_state, block, offset, &n= um); if (!offset_in_ramblock(block, ((ram_addr_t)offset) << TARGET_PAGE_BI= TS)) { offset =3D 0; + num =3D 0; block =3D QLIST_NEXT_RCU(block, next); } else { - migration_bitmap_clear_dirty(ram_state, block, offset); + unsigned long i =3D 0; + + for (i =3D 0; i < num; i++) { + migration_bitmap_clear_dirty(ram_state, block, offset = + i); + } dst_host =3D block->host + (((ram_addr_t)offset) << TARGET_PAGE_BITS); src_host =3D block->colo_cache + (((ram_addr_t)offset) << TARGET_PAGE_BITS); - memcpy(dst_host, src_host, TARGET_PAGE_SIZE); + memcpy(dst_host, src_host, TARGET_PAGE_SIZE * num); + offset +=3D num; } } } --=20 2.33.1 From nobody Mon Feb 9 02:38:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1636445097236346.8697963293574; Tue, 9 Nov 2021 00:04:57 -0800 (PST) Received: from localhost ([::1]:40616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkM7k-0001UK-7d for importer@patchew.org; Tue, 09 Nov 2021 03:04:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkM5s-0007pA-EU for qemu-devel@nongnu.org; Tue, 09 Nov 2021 03:03:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkM5q-0002BH-Hd for qemu-devel@nongnu.org; Tue, 09 Nov 2021 03:03:00 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-20-MC2XV34gPoyLbJXalfJpWw-1; Tue, 09 Nov 2021 03:02:57 -0500 Received: by mail-wr1-f69.google.com with SMTP id v17-20020adfedd1000000b0017c5e737b02so4602850wro.18 for ; Tue, 09 Nov 2021 00:02:56 -0800 (PST) Received: from localhost (static-233-86-86-188.ipcom.comunitel.net. [188.86.86.233]) by smtp.gmail.com with ESMTPSA id l5sm1736899wms.16.2021.11.09.00.02.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 00:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636444978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OUKFfAX6yAgWVQ2yA8gX+VIYcGaVp+VqS/JRh00nJhQ=; b=Ks0W9QShyvommCh+kv133m9aB4QT18xu/L4TSlXG3P14sMao0/AERDELoa6453zQP/2RhL gXIyQGZeYD4e2DyCwsYgZvtCDHHEiq8TWv0D93JY9TxW4GQzrt48K9i81tYD7wUl+5QJEZ FyBuG3UgrhPYsgzlV2SB/61buM8aQW0= X-MC-Unique: MC2XV34gPoyLbJXalfJpWw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OUKFfAX6yAgWVQ2yA8gX+VIYcGaVp+VqS/JRh00nJhQ=; b=Y5hMJh6kHEzBzhO0ZQ7UZxgHdSX5cm1iuo6SpDp+N5JzbTLpxSY65xUnbRiiliZ1TS M/X4YxsEJbZxvf2or/blmh9xh3qas745G8GdtZOPefbL3m8xi6NDBDhvqYF60qAAQfbU JoNN8vg6b6h54xGIl3ThnflhJ8iuukzMxOTcR/lACTrYvJ7dEfP/bzt4RbDmNgIWnkwL d2dAulXZkFY4jVlxJI8d4OtC7cvk6uogVw80FbF+844dqK0lHgIp7NRSxcD0yQpUAnH3 bNb3LiAq5EXCopa3cDgI82aNUvWYZ0lAEGk9X6ZcenGqQb2DFRWnjumQIBHheZQkEVG5 /WMw== X-Gm-Message-State: AOAM5302eqZUGJn/P0BuhK+9KYxWs8PY67V5fRnvPtEq1AzXGuXtdGuJ rTlI54q0C8NhtOFfUoCSGX7yiymgLA61pWw6pl9AjGE0HmxP32tgZk8ktcjlxB9d3KqD/+v1Pmw +6AbM2vCUhsxTqJxspD961tu/Mef1b1FYVnmZjdYDGSft8KYv8Y6S9lOGKg6AG6xBO/Q= X-Received: by 2002:a5d:65c7:: with SMTP id e7mr6835850wrw.319.1636444974626; Tue, 09 Nov 2021 00:02:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiFg1owrd0knkd4H0LvtvH0SwbCWhmzK7ckAop6WYRDctG0TzxTnTCZOO9kKj/oygAdorJ4Q== X-Received: by 2002:a5d:65c7:: with SMTP id e7mr6835816wrw.319.1636444974439; Tue, 09 Nov 2021 00:02:54 -0800 (PST) From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PULL 3/3] Reset the auto-converge counter at every checkpoint. Date: Tue, 9 Nov 2021 09:02:47 +0100 Message-Id: <20211109080247.62559-4-quintela@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211109080247.62559-1-quintela@redhat.com> References: <20211109080247.62559-1-quintela@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=quintela@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.699, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lukas Straub , Hailiang Zhang , Juan Quintela , "Rao, Lei" , Markus Armbruster , "Dr. David Alan Gilbert" , Eric Blake Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1636445097996100001 Content-Type: text/plain; charset="utf-8" From: "Rao, Lei" if we don't reset the auto-converge counter, it will continue to run with COLO running, and eventually the system will hang due to the CPU throttle reaching DEFAULT_MIGRATE_MAX_CPU_THROTTLE. Signed-off-by: Lei Rao Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Lukas Straub Tested-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/ram.h | 1 + migration/colo.c | 4 ++++ migration/ram.c | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/migration/ram.h b/migration/ram.h index dda1988f3d..c515396a9a 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -50,6 +50,7 @@ bool ramblock_is_ignored(RAMBlock *block); int xbzrle_cache_resize(uint64_t new_size, Error **errp); uint64_t ram_bytes_remaining(void); uint64_t ram_bytes_total(void); +void mig_throttle_counter_reset(void); =20 uint64_t ram_pagesize_summary(void); int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); diff --git a/migration/colo.c b/migration/colo.c index e3b1f136f4..2415325262 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -459,6 +459,10 @@ static int colo_do_checkpoint_transaction(MigrationSta= te *s, if (ret < 0) { goto out; } + + if (migrate_auto_converge()) { + mig_throttle_counter_reset(); + } /* * Only save VM's live state, which not including device state. * TODO: We may need a timeout mechanism to prevent COLO process diff --git a/migration/ram.c b/migration/ram.c index f48cf4b0a5..863035d235 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -641,6 +641,15 @@ static void mig_throttle_guest_down(uint64_t bytes_dir= ty_period, } } =20 +void mig_throttle_counter_reset(void) +{ + RAMState *rs =3D ram_state; + + rs->time_last_bitmap_sync =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); + rs->num_dirty_pages_period =3D 0; + rs->bytes_xfer_prev =3D ram_counters.transferred; +} + /** * xbzrle_cache_zero_page: insert a zero page in the XBZRLE cache * --=20 2.33.1