From nobody Sat May 18 10:57:19 2024 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 1638877923533947.1653053138607; Tue, 7 Dec 2021 03:52:03 -0800 (PST) Received: from localhost ([::1]:46468 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muZ0q-0007of-Pj for importer@patchew.org; Tue, 07 Dec 2021 06:52:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzV-0005AJ-12 for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzR-0004lo-Mp for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:36 -0500 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-8-vkIhEvJCNReeLO0E3lD6MA-1; Tue, 07 Dec 2021 06:50:29 -0500 Received: by mail-wr1-f71.google.com with SMTP id q5-20020a5d5745000000b00178abb72486so2859855wrw.9 for ; Tue, 07 Dec 2021 03:50:29 -0800 (PST) Received: from localhost.localdomain ([85.203.46.177]) by smtp.gmail.com with ESMTPSA id g18sm3023551wmq.4.2021.12.07.03.50.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Dec 2021 03:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638877830; 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=MUtpeLYHKQgrc9BMfv66tyCzYEZUrgpReG7BcJQeSaM=; b=JmrRTD+erR9/oWFC9Y28TKxIKyJbukrDSPStI3V5m0t/egXW8xztqDv1KTfJ9KguZGYHeC fksNwiYYmrNblT4MJ4a+rezK4RnqPCh4wFaX1dJF7ZtWRfAsORURgK+maT8TcnBk4kuJnN i9gsM3+d+OwT818NrN/Vtfyyxd+Qqqw= X-MC-Unique: vkIhEvJCNReeLO0E3lD6MA-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=MUtpeLYHKQgrc9BMfv66tyCzYEZUrgpReG7BcJQeSaM=; b=kQ0ctXJym2e/jI+O8//9n6yg1Oyp4Fa2sP5x7VR4PpMkzGXHUPePAHGS/++8vEQok8 325MFkY21fjOObLcIjWvf9Kr71+CIZLSVy0odvWCU7JXh/jttn/A2bEMseffzgbVkaJe 2RVGarLyMRr47QoSa3PjqcAQv8biBt+bz13sPid20+kf2bUh2wS8PdGFGZYa0wcvX4Gd 0BCVFbNkzea2Ab0NNji2nxpetzFqHSLsT3t8MtuE1k+SZ4occcKcjUcUt4FQWf/sCmLB aBhJ8CVQhGYU1u9jXsXjANRrQpC/y1fmtuIhm529yryY5H0HJDhFsAEMkQEOmolCNNmk BlMQ== X-Gm-Message-State: AOAM530O17Gk79DafzF0O8DVkInWKj5cucCTjs5FhAEzydJQdO7lT3xJ 6xP5Z7ZToRfpvvTbBppmVK3Nyo3mTWnNU/ejc26Dn5poZA3UAk0dCxQB+CJlEop63pTXMoE7vau asF0hOp/J8t12Uf9oHt7R4tM6ZQgLFVtTkVyvb5gu+NX7kj5lNvMgFHpVQKzf1gvA X-Received: by 2002:a5d:6da2:: with SMTP id u2mr50037461wrs.273.1638877828175; Tue, 07 Dec 2021 03:50:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJykVUBKt1FImbcPb2AgwarC7z0aRwGenSfhkK4TfDmrZGKnp6W74UfH2MLAGrkGF3J3qOI73w== X-Received: by 2002:a5d:6da2:: with SMTP id u2mr50037428wrs.273.1638877827888; Tue, 07 Dec 2021 03:50:27 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH 1/7] migration: Drop dead code of ram_debug_dump_bitmap() Date: Tue, 7 Dec 2021 19:50:10 +0800 Message-Id: <20211207115016.73195-2-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211207115016.73195-1-peterx@redhat.com> References: <20211207115016.73195-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@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=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.619, 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: Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com, Leonardo Bras Soares Passos 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: 1638877925522100001 Content-Type: text/plain; charset="utf-8" I planned to add "#ifdef DEBUG_POSTCOPY" around the function too because otherwise it'll be compiled into qemu binary even if it'll never be used. = Then I found that maybe it's easier to just drop it for good.. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela --- migration/ram.c | 39 --------------------------------------- migration/ram.h | 2 -- 2 files changed, 41 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 863035d235..756ac800a7 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2413,40 +2413,6 @@ static void ram_state_reset(RAMState *rs) =20 #define MAX_WAIT 50 /* ms, half buffered_file limit */ =20 -/* - * 'expected' is the value you expect the bitmap mostly to be full - * of; it won't bother printing lines that are all this value. - * If 'todump' is null the migration bitmap is dumped. - */ -void ram_debug_dump_bitmap(unsigned long *todump, bool expected, - unsigned long pages) -{ - int64_t cur; - int64_t linelen =3D 128; - char linebuf[129]; - - for (cur =3D 0; cur < pages; cur +=3D linelen) { - int64_t curb; - bool found =3D false; - /* - * Last line; catch the case where the line length - * is longer than remaining ram - */ - if (cur + linelen > pages) { - linelen =3D pages - cur; - } - for (curb =3D 0; curb < linelen; curb++) { - bool thisbit =3D test_bit(cur + curb, todump); - linebuf[curb] =3D thisbit ? '1' : '.'; - found =3D found || (thisbit !=3D expected); - } - if (found) { - linebuf[curb] =3D '\0'; - fprintf(stderr, "0x%08" PRIx64 " : %s\n", cur, linebuf); - } - } -} - /* **** functions for postcopy ***** */ =20 void ram_postcopy_migrated_memory_release(MigrationState *ms) @@ -2674,11 +2640,6 @@ int ram_postcopy_send_discard_bitmap(MigrationState = *ms) if (ret) { return ret; } - -#ifdef DEBUG_POSTCOPY - ram_debug_dump_bitmap(block->bmap, true, - block->used_length >> TARGET_PAGE_BITS); -#endif } trace_ram_postcopy_send_discard_bitmap(); =20 diff --git a/migration/ram.h b/migration/ram.h index c515396a9a..f543e25765 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -55,8 +55,6 @@ void mig_throttle_counter_reset(void); uint64_t ram_pagesize_summary(void); int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t = len); void acct_update_position(QEMUFile *f, size_t size, bool zero); -void ram_debug_dump_bitmap(unsigned long *todump, bool expected, - unsigned long pages); void ram_postcopy_migrated_memory_release(MigrationState *ms); /* For outgoing discard bitmap */ int ram_postcopy_send_discard_bitmap(MigrationState *ms); --=20 2.32.0 From nobody Sat May 18 10:57:19 2024 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 1638877924231399.6431619110408; Tue, 7 Dec 2021 03:52:04 -0800 (PST) Received: from localhost ([::1]:46556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muZ0s-0007s5-Qu for importer@patchew.org; Tue, 07 Dec 2021 06:52:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzW-0005Ae-KW for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24204) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzS-0004ly-LL for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:37 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-275-LlvohfHAOmeunuyemSZtUw-1; Tue, 07 Dec 2021 06:50:32 -0500 Received: by mail-wm1-f69.google.com with SMTP id o18-20020a05600c511200b00332fa17a02eso1245502wms.5 for ; Tue, 07 Dec 2021 03:50:32 -0800 (PST) Received: from localhost.localdomain ([85.203.46.177]) by smtp.gmail.com with ESMTPSA id g18sm3023551wmq.4.2021.12.07.03.50.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Dec 2021 03:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638877833; 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=xkNoxRGiLarQHKJMZMA2Rdjez5Quwer/Kh6c3bPYS8g=; b=OTaTnYRB1xomoWrQF/6W1+40KG1pomOZtS7zjsBilhSz0YiV08xGvNnKBK/G8RPccmzhCR w/cwS+u/KdX1Ypr994Ua7Jv/VoE4/dwVripXU43Ajsdk3mkymPvZ4vihk/nTinlS8A6L6K 0p56YBsBv/KHONokV6/GSYQdYk7snog= X-MC-Unique: LlvohfHAOmeunuyemSZtUw-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=xkNoxRGiLarQHKJMZMA2Rdjez5Quwer/Kh6c3bPYS8g=; b=deuaYVvr6fZQbd+kF8i+NBBvsob4p+rOyhCvRh8WABnySFiQ1tIVithftxV7HniTor rhYVFMpyJL5nd170vQb/a4g2QlQk+wM0pTWjk7UK+MyuTfW0XRlSn3OCidwKTKYvV+GV 1wjFyeD1SWQVLFd+MBJNkP1skC+LqHxwaHMQUI1BbWltVC1vXM8UpdneldIhB/X+7DFc U/jyqPj69FegYmNKQGX1D1N+a8kgwd5+lf8hpuCyZ6e/td+WxDYsZEtLgbmCw1r9q3Re sQkgnRHG/zZQ9Tjr5S7le0Yx56Fnv0cl0Shmn29hA5gIBIcDbU7Aos83Y+/FRtvVS02R t/iQ== X-Gm-Message-State: AOAM530O5YGqx6Ea0JOiP/b4ZOX8hHzSuxHUFUGIiKIQnLS2+OOTmmg/ orabzRXO6b+cVKFRHFtjOBGE0BIbG8WGxlXVrC9g9SQa0eY1zyejVoz5gFp438itr0WjlTIT+5O KPrvsoZicMYkVHBUMneTKdJyT6n0Z1qBfgRAaax94FvqVwz8wz7A0F+Ysn/NfqPVs X-Received: by 2002:a05:600c:4fcc:: with SMTP id o12mr6534703wmq.110.1638877831254; Tue, 07 Dec 2021 03:50:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtLTAVUDCuausXrZXiws+xNCGC4LGpjeafjACE3lCrA5CLMfwtSM3hTHteB9NBfjVmsziB+A== X-Received: by 2002:a05:600c:4fcc:: with SMTP id o12mr6534673wmq.110.1638877831035; Tue, 07 Dec 2021 03:50:31 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH 2/7] migration: Don't return for postcopy_chunk_hostpages() Date: Tue, 7 Dec 2021 19:50:11 +0800 Message-Id: <20211207115016.73195-3-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211207115016.73195-1-peterx@redhat.com> References: <20211207115016.73195-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@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.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.619, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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: Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com, Leonardo Bras Soares Passos 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: 1638877925523100002 Content-Type: text/plain; charset="utf-8" It always return zero, because it just can't go wrong so far. Simplify the code with no functional change. Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- migration/ram.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 756ac800a7..fb8c1a887e 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2585,12 +2585,10 @@ static void postcopy_chunk_hostpages_pass(Migration= State *ms, RAMBlock *block) * dirty host-page size chunks as all dirty. In this case the host-page * is the host-page for the particular RAMBlock, i.e. it might be a huge p= age * - * Returns zero on success - * * @ms: current migration state * @block: block we want to work with */ -static int postcopy_chunk_hostpages(MigrationState *ms, RAMBlock *block) +static void postcopy_chunk_hostpages(MigrationState *ms, RAMBlock *block) { postcopy_discard_send_init(ms, block->idstr); =20 @@ -2600,7 +2598,6 @@ static int postcopy_chunk_hostpages(MigrationState *m= s, RAMBlock *block) postcopy_chunk_hostpages_pass(ms, block); =20 postcopy_discard_send_finish(ms); - return 0; } =20 /** @@ -2622,7 +2619,6 @@ int ram_postcopy_send_discard_bitmap(MigrationState *= ms) { RAMState *rs =3D ram_state; RAMBlock *block; - int ret; =20 RCU_READ_LOCK_GUARD(); =20 @@ -2636,10 +2632,7 @@ int ram_postcopy_send_discard_bitmap(MigrationState = *ms) =20 RAMBLOCK_FOREACH_NOT_IGNORED(block) { /* Deal with TPS !=3D HPS and huge pages */ - ret =3D postcopy_chunk_hostpages(ms, block); - if (ret) { - return ret; - } + postcopy_chunk_hostpages(ms, block); } trace_ram_postcopy_send_discard_bitmap(); =20 --=20 2.32.0 From nobody Sat May 18 10:57:19 2024 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 1638877926183982.9515801878088; Tue, 7 Dec 2021 03:52:06 -0800 (PST) Received: from localhost ([::1]:46984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muZ0v-0008AL-1U for importer@patchew.org; Tue, 07 Dec 2021 06:52:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzY-0005CF-Hv for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:41884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzV-0004mW-Jd for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:39 -0500 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-371-GMY0QYkKNpmNnOx7w4W_KA-1; Tue, 07 Dec 2021 06:50:36 -0500 Received: by mail-wr1-f71.google.com with SMTP id p3-20020a056000018300b00186b195d4ddso2853489wrx.15 for ; Tue, 07 Dec 2021 03:50:35 -0800 (PST) Received: from localhost.localdomain ([85.203.46.177]) by smtp.gmail.com with ESMTPSA id g18sm3023551wmq.4.2021.12.07.03.50.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Dec 2021 03:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638877837; 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=rAhbUGVptyLQwm179+saNf2aDx6aW3dcDYCvczFtWqQ=; b=YtwDJ/eLLwO+dbq4Ax03AsLC/U3frgqAX4Qk0fZ1+DDfMkibGAWBDRt5SVSOEdlSrSZaF0 EezguxxbeIR9sVNosXtUgtC6Wh5K1pgoouSdyImHYlKTNstcqQDlFhqNF+pAmJ77iP/bdk 3cs4aCqNYpES3r6rccizxOIyoIjHuNI= X-MC-Unique: GMY0QYkKNpmNnOx7w4W_KA-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=rAhbUGVptyLQwm179+saNf2aDx6aW3dcDYCvczFtWqQ=; b=Xwr4zydQx7BEtHfwmeIu6P+1P7wjvtKqJZvdgiq2wadYv+/AUAtMTAaERnKHayiUG/ EykhTOmmyhuN4PUpzYkPQxoDQl1V9GDv40FjxblMkcb4XSSyglZ5kcFMANoOrzZsdY2n RLzxSuusNuXs8t1UGmOtf8hEOUAv1gGzarQnQXHqRrUSLb9SCswZrkyj0hRcPx8rLhGf gd+qcKff+pVZPh972xEMIua/pyrEDND6eNfu/12vvKkRCt38WFOr9WCZJtjV0h2y2C7f k5cvaAZj4ioDiY/a637Ucu/+A1e/TBTn+0MDeRLFDrzX4teEpyJT9ChqfTSk7YSiFofR 2eUg== X-Gm-Message-State: AOAM531wg6YsqaYVIVBO1wuChZHrmN1jm9ZR8GOXdZzxYwztv9mTz8KP wN7wY4XGCIee0taKKGp5xmit5dSOHLG1rpocFnxKUrv+VPAAhMOR1UnRtZIKT0CGIZmdESqbix0 yIXt+pGVxqyxQRJncgngZ7DG3xmWIQBLdbQ1YdEFkGVIpgS4ULNjMkj07yG4dGnxF X-Received: by 2002:a05:600c:4ed2:: with SMTP id g18mr6497707wmq.122.1638877834519; Tue, 07 Dec 2021 03:50:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZNu2t6Er06ZZETWwWloWtg613yfsEnN/7hfhvtpzfTdqXYas9RrIzN/ImEj71+Jpo8c5Q+w== X-Received: by 2002:a05:600c:4ed2:: with SMTP id g18mr6497658wmq.122.1638877834145; Tue, 07 Dec 2021 03:50:34 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH 3/7] migration: Drop postcopy_chunk_hostpages() Date: Tue, 7 Dec 2021 19:50:12 +0800 Message-Id: <20211207115016.73195-4-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211207115016.73195-1-peterx@redhat.com> References: <20211207115016.73195-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@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.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.619, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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: Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com, Leonardo Bras Soares Passos 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: 1638877927852100003 Content-Type: text/plain; charset="utf-8" This function calls three functions: - postcopy_discard_send_init(ms, block->idstr); - postcopy_chunk_hostpages_pass(ms, block); - postcopy_discard_send_finish(ms); However only the 2nd function call is meaningful. It's major role is to ma= ke sure dirty bits are applied in host-page-size granule, so there will be no partial dirty bits set for a whole host page if huge pages are used. The 1st/3rd call are for latter when we want to send the disgard ranges. They're mostly no-op here besides some tracepoints (which are misleading!). Drop them, then we can directly drop postcopy_chunk_hostpages() as a whole because we can call postcopy_chunk_hostpages_pass() directly. There're still some nice comments above postcopy_chunk_hostpages() that exp= lain what it does. Copy it over to the caller's site. Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- migration/ram.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index fb8c1a887e..e3876181ab 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2576,30 +2576,6 @@ static void postcopy_chunk_hostpages_pass(MigrationS= tate *ms, RAMBlock *block) } } =20 -/** - * postcopy_chunk_hostpages: discard any partially sent host page - * - * Utility for the outgoing postcopy code. - * - * Discard any partially sent host-page size chunks, mark any partially - * dirty host-page size chunks as all dirty. In this case the host-page - * is the host-page for the particular RAMBlock, i.e. it might be a huge p= age - * - * @ms: current migration state - * @block: block we want to work with - */ -static void postcopy_chunk_hostpages(MigrationState *ms, RAMBlock *block) -{ - postcopy_discard_send_init(ms, block->idstr); - - /* - * Ensure that all partially dirty host pages are made fully dirty. - */ - postcopy_chunk_hostpages_pass(ms, block); - - postcopy_discard_send_finish(ms); -} - /** * ram_postcopy_send_discard_bitmap: transmit the discard bitmap * @@ -2631,8 +2607,13 @@ int ram_postcopy_send_discard_bitmap(MigrationState = *ms) rs->last_page =3D 0; =20 RAMBLOCK_FOREACH_NOT_IGNORED(block) { - /* Deal with TPS !=3D HPS and huge pages */ - postcopy_chunk_hostpages(ms, block); + /* + * Deal with TPS !=3D HPS and huge pages. It discard any partiall= y sent + * host-page size chunks, mark any partially dirty host-page size + * chunks as all dirty. In this case the host-page is the host-pa= ge + * for the particular RAMBlock, i.e. it might be a huge page. + */ + postcopy_chunk_hostpages_pass(ms, block); } trace_ram_postcopy_send_discard_bitmap(); =20 --=20 2.32.0 From nobody Sat May 18 10:57:19 2024 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 1638878061081575.9073571796034; Tue, 7 Dec 2021 03:54:21 -0800 (PST) Received: from localhost ([::1]:55096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muZ35-00057e-I3 for importer@patchew.org; Tue, 07 Dec 2021 06:54:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYza-0005FC-FR for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:23826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzY-0004mq-Jj for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:42 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-205-9xJepUNdO7aFGVTzhri_4g-1; Tue, 07 Dec 2021 06:50:39 -0500 Received: by mail-wr1-f72.google.com with SMTP id d3-20020adfa343000000b0018ed6dd4629so2878261wrb.2 for ; Tue, 07 Dec 2021 03:50:38 -0800 (PST) Received: from localhost.localdomain ([85.203.46.177]) by smtp.gmail.com with ESMTPSA id g18sm3023551wmq.4.2021.12.07.03.50.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Dec 2021 03:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638877839; 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=Gr5NwmK4C6rrByv/piWEyyUxv3c8z1nDTJmNvLm7N4I=; b=O8L/fDBog8QeOhQZr6wOHYx5qAAs3/JIjZ32ig39E3173lxp/Jb46b1bdGSeUtR6EbS4kC c3RNO+vCiQWbDwiTT9Unn78SRI8vtlwK/93t3z26MnN1iA5adisnO55Mon6niqdRmvsCK6 uBYTERflv+/pDAZEIZ3fStNDg08eKqE= X-MC-Unique: 9xJepUNdO7aFGVTzhri_4g-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=Gr5NwmK4C6rrByv/piWEyyUxv3c8z1nDTJmNvLm7N4I=; b=ALO+LBkGkgJwL3gNwvXz1NjIeh+oPK1SinY90cBtGnOy3FCI4sJpIwcbgvr4sCNs3d 5yjlzRAhc4b5Ox9kzCwbECXNBhxwdnxNY7A85m+AayRYoz2zNSzg5UpCI3FikPw4rQte KU1Lk/8c3JUWYeKrGKkLZX2xBmzEjjuOIKn2covFd8klCvKnaAqQ75XXH2jZzS2Naum0 gjRkxf3e23sIcKQA2DkH/VaDqLGQ96NCfR4gLj0u4MiffDNGQBRvV1uf8u8gFjF3g0QP E+YQjrW9e+KduePvg9WYPFcnlCRhI4RwV02TPK132gPuLythbIZdqapmmjht7gmeSJL5 NDlQ== X-Gm-Message-State: AOAM533HJgITN7qDzSYJdc6sZkjSzxH/7rGjMIhrE1T6rj0AINM/vuZc rWomiCBv0msKwXqfFCfNXiQhc313IHx0W9fngPzz4egFWa2v2iAloUkYiLyfpBlh1ekag/7zZ9z xgUDJSp72OQDRPk0LLeNSTwkGMloRYJT0zCvrAORhYTDwtgrDJe2sgBHnTqXOJO/f X-Received: by 2002:a5d:452b:: with SMTP id j11mr51359223wra.432.1638877837585; Tue, 07 Dec 2021 03:50:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDJElVsJEA477aKZQv6kVgu0cBBTzRCB+SSL3iwouV1C6z1F9VeSjbS7OvvDJj18KV+KhY7w== X-Received: by 2002:a5d:452b:: with SMTP id j11mr51359195wra.432.1638877837322; Tue, 07 Dec 2021 03:50:37 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH 4/7] migration: Do chunk page in postcopy_each_ram_send_discard() Date: Tue, 7 Dec 2021 19:50:13 +0800 Message-Id: <20211207115016.73195-5-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211207115016.73195-1-peterx@redhat.com> References: <20211207115016.73195-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@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.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.619, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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: Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com, Leonardo Bras Soares Passos 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: 1638878061569100001 Content-Type: text/plain; charset="utf-8" Right now we loop ramblocks for twice, the 1st time chunk the dirty bits wi= th huge page information; the 2nd time we send the discard ranges. That's not necessary - we can do them in a single loop. Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- migration/ram.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index e3876181ab..ecc744d54d 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2473,6 +2473,8 @@ static int postcopy_send_discard_bm_ram(MigrationStat= e *ms, RAMBlock *block) return 0; } =20 +static void postcopy_chunk_hostpages_pass(MigrationState *ms, RAMBlock *bl= ock); + /** * postcopy_each_ram_send_discard: discard all RAMBlocks * @@ -2494,6 +2496,14 @@ static int postcopy_each_ram_send_discard(MigrationS= tate *ms) RAMBLOCK_FOREACH_NOT_IGNORED(block) { postcopy_discard_send_init(ms, block->idstr); =20 + /* + * Deal with TPS !=3D HPS and huge pages. It discard any partiall= y sent + * host-page size chunks, mark any partially dirty host-page size + * chunks as all dirty. In this case the host-page is the host-pa= ge + * for the particular RAMBlock, i.e. it might be a huge page. + */ + postcopy_chunk_hostpages_pass(ms, block); + /* * Postcopy sends chunks of bitmap over the wire, but it * just needs indexes at this point, avoids it having @@ -2594,7 +2604,6 @@ static void postcopy_chunk_hostpages_pass(MigrationSt= ate *ms, RAMBlock *block) int ram_postcopy_send_discard_bitmap(MigrationState *ms) { RAMState *rs =3D ram_state; - RAMBlock *block; =20 RCU_READ_LOCK_GUARD(); =20 @@ -2606,15 +2615,6 @@ int ram_postcopy_send_discard_bitmap(MigrationState = *ms) rs->last_sent_block =3D NULL; rs->last_page =3D 0; =20 - RAMBLOCK_FOREACH_NOT_IGNORED(block) { - /* - * Deal with TPS !=3D HPS and huge pages. It discard any partiall= y sent - * host-page size chunks, mark any partially dirty host-page size - * chunks as all dirty. In this case the host-page is the host-pa= ge - * for the particular RAMBlock, i.e. it might be a huge page. - */ - postcopy_chunk_hostpages_pass(ms, block); - } trace_ram_postcopy_send_discard_bitmap(); =20 return postcopy_each_ram_send_discard(ms); --=20 2.32.0 From nobody Sat May 18 10:57:19 2024 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 1638878057961952.8124014152191; Tue, 7 Dec 2021 03:54:17 -0800 (PST) Received: from localhost ([::1]:54972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muZ32-00052d-Kz for importer@patchew.org; Tue, 07 Dec 2021 06:54:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYze-0005U2-Fe for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:29320) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzc-0004nN-57 for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:46 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-247-jnJcOcdbNsu0cWdKJg6tLQ-1; Tue, 07 Dec 2021 06:50:42 -0500 Received: by mail-wm1-f69.google.com with SMTP id o18-20020a05600c511200b00332fa17a02eso1245753wms.5 for ; Tue, 07 Dec 2021 03:50:42 -0800 (PST) Received: from localhost.localdomain ([85.203.46.177]) by smtp.gmail.com with ESMTPSA id g18sm3023551wmq.4.2021.12.07.03.50.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Dec 2021 03:50:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638877843; 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=jMsW81eHVdDwi81RlGTDlPytpvgOEcWCkpJFVmQ/AtA=; b=NfS8n06hk6AJMMuxXwy95McjLdThdM8n9G9/irZ6qg+4YerapBLaOCTMZ1XHlka6bvyqo4 xtixK4hncHOvf35dn1JAcQs1vduaxIEYlq7Acxc5NEuyiC+SBuBB8CcpY9Szq4C33rKgVm FxwdxTLpSKOaCz9JXYxus+c8O87pEKk= X-MC-Unique: jnJcOcdbNsu0cWdKJg6tLQ-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=jMsW81eHVdDwi81RlGTDlPytpvgOEcWCkpJFVmQ/AtA=; b=6LaGzS21vq6iYz1yPDK9/28pZ1bihMyK5/67Y8FxeTnqtiKKH9n+Q5dJv81HKOa3QQ p56OVvFqc/fpv5nJD5iOlxbojptRowDtpBTFqBVpfe9xj3B+9V67GKnDquU/Me2DP1Gm +DpQDbyhXxiChXx1qclhu5pFrWAQ4brrXmj49d3r6dhiq6b1EAah7aUJavh/ykpPlJ39 PzMLzGcPEMO7/zGEFsZN8tDP+AUwHYKzWoK5FJneHGe+E1UGYHA6L+NtHND9vGMVf1/M r6LPJ3fRmsGNTJfI+7Mafz61FKbYl8knC6soPMj9iWEx6UgDvDYMg8jJpWR2bHQlvESx 5IBw== X-Gm-Message-State: AOAM5304nlNxDjsGKDw+yk401tAiucNV3ZaQo7HssI9oXHn0rAGx52MZ bQcrLGcHjIMzEi7yVFtYFCgog2l7OOeY5PtQO87TaDi3ZB8OpT0DymwpcVqwoxiQbzIDn4OkdTa lnseipZPZu0x0qYV9kUb3Fmu0N9/U3DRJtkCQn1weleaQI8U1oea1t4a5enJR6kxT X-Received: by 2002:a5d:424c:: with SMTP id s12mr50107038wrr.370.1638877840925; Tue, 07 Dec 2021 03:50:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYULnR0sVvSTYBCIH1u/yiSMXNORcwuXFonw2VQmE61uZ9TSdRC1jTzDgLZXE1e3LvjfmgrQ== X-Received: by 2002:a5d:424c:: with SMTP id s12mr50107010wrr.370.1638877840664; Tue, 07 Dec 2021 03:50:40 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH 5/7] migration: Drop return code for disgard ram process Date: Tue, 7 Dec 2021 19:50:14 +0800 Message-Id: <20211207115016.73195-6-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211207115016.73195-1-peterx@redhat.com> References: <20211207115016.73195-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@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.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.619, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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: Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com, Leonardo Bras Soares Passos 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: 1638878059435100001 Content-Type: text/plain; charset="utf-8" It will just never fail. Drop those return values where they're constantly zeros. A tiny touch-up on the tracepoint so trace_ram_postcopy_send_discard_bitmap= () is called after the logic itself (which sounds more reasonable). Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- migration/migration.c | 5 +---- migration/ram.c | 20 +++++--------------- migration/ram.h | 2 +- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index abaf6f9e3d..c2e5539721 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2983,10 +2983,7 @@ static int postcopy_start(MigrationState *ms) * that are dirty */ if (migrate_postcopy_ram()) { - if (ram_postcopy_send_discard_bitmap(ms)) { - error_report("postcopy send discard bitmap failed"); - goto fail; - } + ram_postcopy_send_discard_bitmap(ms); } =20 /* diff --git a/migration/ram.c b/migration/ram.c index ecc744d54d..28f1ace0f7 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2478,8 +2478,6 @@ static void postcopy_chunk_hostpages_pass(MigrationSt= ate *ms, RAMBlock *block); /** * postcopy_each_ram_send_discard: discard all RAMBlocks * - * Returns 0 for success or negative for error - * * Utility for the outgoing postcopy code. * Calls postcopy_send_discard_bm_ram for each RAMBlock * passing it bitmap indexes and name. @@ -2488,10 +2486,9 @@ static void postcopy_chunk_hostpages_pass(MigrationS= tate *ms, RAMBlock *block); * * @ms: current migration state */ -static int postcopy_each_ram_send_discard(MigrationState *ms) +static void postcopy_each_ram_send_discard(MigrationState *ms) { struct RAMBlock *block; - int ret; =20 RAMBLOCK_FOREACH_NOT_IGNORED(block) { postcopy_discard_send_init(ms, block->idstr); @@ -2509,14 +2506,9 @@ static int postcopy_each_ram_send_discard(MigrationS= tate *ms) * just needs indexes at this point, avoids it having * target page specific code. */ - ret =3D postcopy_send_discard_bm_ram(ms, block); + postcopy_send_discard_bm_ram(ms, block); postcopy_discard_send_finish(ms); - if (ret) { - return ret; - } } - - return 0; } =20 /** @@ -2589,8 +2581,6 @@ static void postcopy_chunk_hostpages_pass(MigrationSt= ate *ms, RAMBlock *block) /** * ram_postcopy_send_discard_bitmap: transmit the discard bitmap * - * Returns zero on success - * * Transmit the set of pages to be discarded after precopy to the target * these are pages that: * a) Have been previously transmitted but are now dirty again @@ -2601,7 +2591,7 @@ static void postcopy_chunk_hostpages_pass(MigrationSt= ate *ms, RAMBlock *block) * * @ms: current migration state */ -int ram_postcopy_send_discard_bitmap(MigrationState *ms) +void ram_postcopy_send_discard_bitmap(MigrationState *ms) { RAMState *rs =3D ram_state; =20 @@ -2615,9 +2605,9 @@ int ram_postcopy_send_discard_bitmap(MigrationState *= ms) rs->last_sent_block =3D NULL; rs->last_page =3D 0; =20 - trace_ram_postcopy_send_discard_bitmap(); + postcopy_each_ram_send_discard(ms); =20 - return postcopy_each_ram_send_discard(ms); + trace_ram_postcopy_send_discard_bitmap(); } =20 /** diff --git a/migration/ram.h b/migration/ram.h index f543e25765..2c6dc3675d 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -57,7 +57,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t s= tart, ram_addr_t len); void acct_update_position(QEMUFile *f, size_t size, bool zero); void ram_postcopy_migrated_memory_release(MigrationState *ms); /* For outgoing discard bitmap */ -int ram_postcopy_send_discard_bitmap(MigrationState *ms); +void ram_postcopy_send_discard_bitmap(MigrationState *ms); /* For incoming postcopy discard */ int ram_discard_range(const char *block_name, uint64_t start, size_t lengt= h); int ram_postcopy_incoming_init(MigrationIncomingState *mis); --=20 2.32.0 From nobody Sat May 18 10:57:19 2024 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 1638878065274413.15215727470877; Tue, 7 Dec 2021 03:54:25 -0800 (PST) Received: from localhost ([::1]:55052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muZ34-00055i-LF for importer@patchew.org; Tue, 07 Dec 2021 06:54:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzg-0005dN-Q8 for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:59053) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzf-0004q1-5z for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:48 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-521-K0-g76nMMdOArgdC3nFvUA-1; Tue, 07 Dec 2021 06:50:45 -0500 Received: by mail-wm1-f71.google.com with SMTP id n16-20020a05600c3b9000b003331973fdbbso1267384wms.0 for ; Tue, 07 Dec 2021 03:50:45 -0800 (PST) Received: from localhost.localdomain ([85.203.46.177]) by smtp.gmail.com with ESMTPSA id g18sm3023551wmq.4.2021.12.07.03.50.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Dec 2021 03:50:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638877846; 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=ME4kLSP5lhgHWBxXaiMyGh0qPJuS3dwOj2lYhY6dAjo=; b=Cotr6Vo5zDYWP5+IkmC2BrWUSQOKoOpTIPByakqvU/oX3ZJntvCh1DOC1GwmsmkZ6m8Zpb BPC/w9LrExGO7xN3SRFNIiBkYcYhHZ1Kg5xyLRREi9wUlKIXWydRAYz/mmkI03PxaRJmCa S3v+E7yOF5mtgyoloLJ6hfcmySU0hlE= X-MC-Unique: K0-g76nMMdOArgdC3nFvUA-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=ME4kLSP5lhgHWBxXaiMyGh0qPJuS3dwOj2lYhY6dAjo=; b=K9RyD5MhAgDeFfXkoZ8hqH2VfWKkrw9SLvJMKrqGdoSg1ZfN8qcchrR9TESg0gWHQo UQoZ3KMx/iTSl6Y1GOye8jc6Vbu76/j+4DGcyG5LMjexuHdaN+tHkdxV7ecQzUW5e4rg SngmFDNmgfk5XsYQy+cEoZfjuPwSDRvy/WD5a0dP+xB4Hei8a02vwZ68WSAfSlhEm+c7 X5s7A49Xpp0bh/tWTgXPg492v9wcZUJp6RCnXnf3+6M61YkxSx/hirkmDDglvK+JmteF jP/bkV8yN4gcic7Xe97jzI2iNmGN3RMSo87m51WMBkCwrQCHat7aaqDhI3/QyQU+NDkf M+ew== X-Gm-Message-State: AOAM532ew1rm1d218bebQ9Bdx3Aom4yDhX29k6EvtHwOqi1cyoXjdHJZ zrQaNcGGmA0ZGmZCiOubqB3nZcUIdGAkTOVTNFRl+OLf570dnu8hhjGaXXpPpQdvvZUTnAqIxby +Q99HhXu2hRVUlauzMDsF2JAzKcz3PUboeGMZ1VBP+pMfUayF3QxeaVwqVVsT54bZ X-Received: by 2002:adf:d1cb:: with SMTP id b11mr50576232wrd.33.1638877844100; Tue, 07 Dec 2021 03:50:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzD1HuLxZAei45zNliLwJwcvBvWF6Nac3TfpekFsb6QvaH4/80VgczYPsP9np8UYxGTQK/OxA== X-Received: by 2002:adf:d1cb:: with SMTP id b11mr50576204wrd.33.1638877843835; Tue, 07 Dec 2021 03:50:43 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH 6/7] migration: Dump sub-cmd name in loadvm_process_command tp Date: Tue, 7 Dec 2021 19:50:15 +0800 Message-Id: <20211207115016.73195-7-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211207115016.73195-1-peterx@redhat.com> References: <20211207115016.73195-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@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.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.619, 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_H3=0.001, RCVD_IN_MSPIKE_WL=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: Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com, Leonardo Bras Soares Passos 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: 1638878066217100001 Content-Type: text/plain; charset="utf-8" It'll be easier to read the name rather than index of sub-cmd when debuggin= g. Signed-off-by: Peter Xu --- migration/savevm.c | 2 +- migration/trace-events | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index d59e976d50..17b8e25e00 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2271,7 +2271,7 @@ static int loadvm_process_command(QEMUFile *f) return qemu_file_get_error(f); } =20 - trace_loadvm_process_command(cmd, len); + trace_loadvm_process_command(mig_cmd_args[cmd].name, len); if (cmd >=3D MIG_CMD_MAX || cmd =3D=3D MIG_CMD_INVALID) { error_report("MIG_CMD 0x%x unknown (len 0x%x)", cmd, len); return -EINVAL; diff --git a/migration/trace-events b/migration/trace-events index b48d873b8a..d63a5915f5 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -22,7 +22,7 @@ loadvm_postcopy_handle_resume(void) "" loadvm_postcopy_ram_handle_discard(void) "" loadvm_postcopy_ram_handle_discard_end(void) "" loadvm_postcopy_ram_handle_discard_header(const char *ramid, uint16_t len)= "%s: %ud" -loadvm_process_command(uint16_t com, uint16_t len) "com=3D0x%x len=3D%d" +loadvm_process_command(const char *s, uint16_t len) "com=3D%s len=3D%d" loadvm_process_command_ping(uint32_t val) "0x%x" postcopy_ram_listen_thread_exit(void) "" postcopy_ram_listen_thread_start(void) "" --=20 2.32.0 From nobody Sat May 18 10:57:19 2024 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 1638878185361904.1188799016012; Tue, 7 Dec 2021 03:56:25 -0800 (PST) Received: from localhost ([::1]:60590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muZ56-0000M1-AG for importer@patchew.org; Tue, 07 Dec 2021 06:56:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzk-0005jq-Jt for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muYzj-0004qz-0p for qemu-devel@nongnu.org; Tue, 07 Dec 2021 06:50:52 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-278-mVondn6qPOGvJeDhD4fAmQ-1; Tue, 07 Dec 2021 06:50:48 -0500 Received: by mail-wr1-f70.google.com with SMTP id c4-20020adfed84000000b00185ca4eba36so2844702wro.21 for ; Tue, 07 Dec 2021 03:50:48 -0800 (PST) Received: from localhost.localdomain ([85.203.46.177]) by smtp.gmail.com with ESMTPSA id g18sm3023551wmq.4.2021.12.07.03.50.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Dec 2021 03:50:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638877849; 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=T09as+BM23dap9ugeHe48STRkXtr+9Qwlc857UXESkg=; b=EOUeJdv7h0gbWhaK+BFh9ONj43rDlzHPorLgbkvay6GMVtK+xx9OlOaldSagpeZRDfRUaP +iKCWqeim3Xuud9W2ESwDB+erx/HOAYPRXCveubYZbo2EBjAkP+PV2C/R1XNT7sjkE3Gvt YA9GrUYtBao9BEw5halsCaw3S5L6mIM= X-MC-Unique: mVondn6qPOGvJeDhD4fAmQ-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=T09as+BM23dap9ugeHe48STRkXtr+9Qwlc857UXESkg=; b=4sOzt8328SR1q3yNnDG2ffVsTcqIPfE9Eyjt/3d4sK077Ij9ofCb+Z5NCuhvbT3Zvf LNR55SQ4bUovG3fckgFlpley1Hyr6QPQp7EeZZMixU4V0oS3JY7PrGF6ApA3n9pmiLKN FBWUD+CE+ReSY3G6jAlrETSyQh1pJcZQAmEdFoNjniKdneYGXDvpR/89/lzcXqK88sx9 RMhAZlKsECEx579s01iQFoI9fUYUZWqEOO5AKJ0wbTthbDhEt0rB5piql0Z/QobKbbeC qDPvF2GWFPUBVbbYrhLbH/1tfGv4AT/RQTVyPJZ5Au3TISr7rX1KcdnVNTolbXpPW8Tz FgUg== X-Gm-Message-State: AOAM531uSrqIr/afG7wp9X98mf5kweEB7ASlF8PFbw8Re/qORlfCqC9j E/k8SiQYILd3Qwj2PROkm0S1OsRttqDEKmtwK91ZSATpmXEMZ1uRTaN9axLAb3wzk1FG2u6lwsp pluwodKi403XQdcI9naPNuxJUGXYu2QQ6IiZyuYYWuox92qiuDHRqfi8oEgu38huW X-Received: by 2002:a7b:cd90:: with SMTP id y16mr6465040wmj.84.1638877847350; Tue, 07 Dec 2021 03:50:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRhHKZxznmKE8vs1D/ydUO31XRbRevUOb4EibuxR1ArInxTS9DjyX7IqJ+6eHNN88K6KXN7A== X-Received: by 2002:a7b:cd90:: with SMTP id y16mr6465006wmj.84.1638877847054; Tue, 07 Dec 2021 03:50:47 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH 7/7] migration: Finer grained tracepoints for POSTCOPY_LISTEN Date: Tue, 7 Dec 2021 19:50:16 +0800 Message-Id: <20211207115016.73195-8-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211207115016.73195-1-peterx@redhat.com> References: <20211207115016.73195-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@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=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.619, 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: Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com, Leonardo Bras Soares Passos 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: 1638878185691100001 Content-Type: text/plain; charset="utf-8" The enablement of postcopy listening has a few steps, add a few tracepoints= to be there ready for some basic measurements for them. Signed-off-by: Peter Xu --- migration/savevm.c | 5 ++++- migration/trace-events | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 17b8e25e00..5b3f31eab2 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1946,7 +1946,7 @@ static void *postcopy_ram_listen_thread(void *opaque) static int loadvm_postcopy_handle_listen(MigrationIncomingState *mis) { PostcopyState ps =3D postcopy_state_set(POSTCOPY_INCOMING_LISTENING); - trace_loadvm_postcopy_handle_listen(); + trace_loadvm_postcopy_handle_listen(1); Error *local_err =3D NULL; =20 if (ps !=3D POSTCOPY_INCOMING_ADVISE && ps !=3D POSTCOPY_INCOMING_DISC= ARD) { @@ -1962,6 +1962,7 @@ static int loadvm_postcopy_handle_listen(MigrationInc= omingState *mis) postcopy_ram_prepare_discard(mis); } } + trace_loadvm_postcopy_handle_listen(2); =20 /* * Sensitise RAM - can now generate requests for blocks that don't exi= st @@ -1974,6 +1975,7 @@ static int loadvm_postcopy_handle_listen(MigrationInc= omingState *mis) return -1; } } + trace_loadvm_postcopy_handle_listen(3); =20 if (postcopy_notify(POSTCOPY_NOTIFY_INBOUND_LISTEN, &local_err)) { error_report_err(local_err); @@ -1988,6 +1990,7 @@ static int loadvm_postcopy_handle_listen(MigrationInc= omingState *mis) QEMU_THREAD_DETACHED); qemu_sem_wait(&mis->listen_thread_sem); qemu_sem_destroy(&mis->listen_thread_sem); + trace_loadvm_postcopy_handle_listen(4); =20 return 0; } diff --git a/migration/trace-events b/migration/trace-events index d63a5915f5..1aa6937dc1 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -14,7 +14,7 @@ loadvm_handle_cmd_packaged_main(int ret) "%d" loadvm_handle_cmd_packaged_received(int ret) "%d" loadvm_handle_recv_bitmap(char *s) "%s" loadvm_postcopy_handle_advise(void) "" -loadvm_postcopy_handle_listen(void) "" +loadvm_postcopy_handle_listen(int i) "%d" loadvm_postcopy_handle_run(void) "" loadvm_postcopy_handle_run_cpu_sync(void) "" loadvm_postcopy_handle_run_vmstart(void) "" --=20 2.32.0