From nobody Sat May 18 10:57:14 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 1640329835489389.82021921378816; Thu, 23 Dec 2021 23:10:35 -0800 (PST) Received: from localhost ([::1]:59640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0eio-0007mA-Bx for importer@patchew.org; Fri, 24 Dec 2021 02:10:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePD-0001BS-AF for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePA-0005jd-CA for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:17 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-enEBE_ctOiK2I11EBt-j0g-1; Fri, 24 Dec 2021 01:50:13 -0500 Received: by mail-wr1-f69.google.com with SMTP id f13-20020adfe90d000000b001a15c110077so1459212wrm.8 for ; Thu, 23 Dec 2021 22:50:13 -0800 (PST) Received: from localhost.localdomain ([64.64.123.8]) by smtp.gmail.com with ESMTPSA id h14sm2174425wmq.16.2021.12.23.22.50.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 22:50:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640328615; 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=ecah2F3ip++NB/Ieyt+yzJHuIzEQ9K69zd4gUhkv1A4=; b=Exh+1EUBS7j/4ckbasNuwfyHJHbntVpW8DvRyHeqRl3rOko04uSOwEHi2LUQAapeVp3ONg Z6lnl4KWf66nJ2TPxcd7GD/CLiM+nE0PMC/ZI/MCMfDViBjFfzf3h5UdV3dWBFg9JPTL9k kRxovQPJiBevY6nyShRqWKnw6z+Okic= X-MC-Unique: enEBE_ctOiK2I11EBt-j0g-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=ecah2F3ip++NB/Ieyt+yzJHuIzEQ9K69zd4gUhkv1A4=; b=XI+BEbgC9GIeMwWWiAbL1uden+evFwlW+mPrJJr2gqegJvFCGZkdKRJYCFyNBxh3vt ZgbqW6eTlDVk2zNMnFQECXTLMVLH5fD6YCum4/7WmtMNPoYAPl9bIXY/xJyfbYOdOdmD FlRZQIW371/vJVP/BCG+JKVudDE+SK4iUQzQtTqTkYMBUxB89wj4CdLmpYlYi+23Toa6 5AJzodF21AGdt2Ef2DT/YousIbHmt0SmdiPmws8xGRrNkMITulkltu42qhAJOR/7O/zI w0eK4dNruw4oHO+ngT+zL73OqMLl/lO2PW8+fadd5Ny7LlLrPuOwjz0jPLHxSmasufzG pxkg== X-Gm-Message-State: AOAM532kWSZh2GY0+Ed/r6uU9MUp0y7RE3bLYM9ML6Z1/D0ltKZzwGR2 0EAsgIJKnajVu8O2MVW60oi/qtttpwDU7aZoRLdNHjs6VYSOBK32fZfi14Cj3JGgkQ60RWJEIfn /kMBPgCERufIxRHXemC4GXamJxgHSbOFEzn5TsTxq0QoTJzJm1CxO7qUHVKnagubx X-Received: by 2002:adf:e6c9:: with SMTP id y9mr3787707wrm.697.1640328612315; Thu, 23 Dec 2021 22:50:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiT7QqfluNIHcpsAtIQMKUt5mtgl/G/5w/mzfvxoEQcJhivMej06Nliimzq65Met1NMKXegw== X-Received: by 2002:adf:e6c9:: with SMTP id y9mr3787687wrm.697.1640328612025; Thu, 23 Dec 2021 22:50:12 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH v3 1/8] migration: Drop dead code of ram_debug_dump_bitmap() Date: Fri, 24 Dec 2021 14:49:53 +0800 Message-Id: <20211224065000.97572-2-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211224065000.97572-1-peterx@redhat.com> References: <20211224065000.97572-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: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, 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: David Edmondson , "Dr . David Alan Gilbert" , Leonardo Bras Soares Passos , peterx@redhat.com, Juan Quintela 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: 1640329837019100001 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.. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- migration/ram.c | 39 --------------------------------------- migration/ram.h | 2 -- 2 files changed, 41 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 57efa67f20..7d9c8a508b 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2408,40 +2408,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) @@ -2669,11 +2635,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:14 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 164032902713695.64791866603161; Thu, 23 Dec 2021 22:57:07 -0800 (PST) Received: from localhost ([::1]:43218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0eVm-0004Fz-1H for importer@patchew.org; Fri, 24 Dec 2021 01:57:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePE-0001BZ-PY for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePD-0005lR-6u for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:20 -0500 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-SulEh9ZPNwKLxUUhHbvpkQ-1; Fri, 24 Dec 2021 01:50:17 -0500 Received: by mail-wm1-f72.google.com with SMTP id v23-20020a05600c215700b0034566adb612so2920768wml.0 for ; Thu, 23 Dec 2021 22:50:17 -0800 (PST) Received: from localhost.localdomain ([64.64.123.8]) by smtp.gmail.com with ESMTPSA id h14sm2174425wmq.16.2021.12.23.22.50.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 22:50:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640328618; 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=VoMC7RjlqJ2CSRkrxYjUsH/v97JY1NqZo29Zh/Eb8IM=; b=azlLzCnTtdWw4GgWEt/3xStbgAqgF+9J80W6clnruww8AnCLLirmGnkiMQOgEipQnk/in1 3eTXybbW3PMm34QUBD9FgfRBWG4I1Yvxdey8YUW9zg1v5i9Xaise4LYdZaKmV0iZXupq9b Jfkar5YWP2kBinB9eY6yBa2oYKMPeeg= X-MC-Unique: SulEh9ZPNwKLxUUhHbvpkQ-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=VoMC7RjlqJ2CSRkrxYjUsH/v97JY1NqZo29Zh/Eb8IM=; b=ecYpOmJuSZFtIhRjLWArkF2nDo+ALlLljWONTeLTqoH+UelthIq1wkbZxmoJyaBJIO KY6p3LBOPjCKECK8QTD5ZnaF909XPeaRxbiFox1+zN8C757NnANR+rb4Hd39be7M65Pk KRWGEuaRpaQYNYTkYvoAUQnP+vlrmaMwbAE6zKvs/6gsp5UWA91gSSCXJah1FZLg52Am 7YYdbhmTnHXIva5LwRGNvjzhoSw0AEnGqesQG0nHTh4eF1WgFnFGfoOpYCi3OmE2xp6N rvSBYSo2OH6OyxZHB+KiF9ikOsrayg4mXlPLQyGExhhHYnUB/xxNK33Qre+d+CtVC9wz kvlQ== X-Gm-Message-State: AOAM532+f+D0tZwT0FnZTNnuSUEU8O67erDwuObovf8/o2pRmBxcoZ1l /cgFFOfhW00VIkCQen9PJgZ+oBd+ha6mi6OEwVME2R7NMUobZ/ixMhWuQ2C3fXRk6r20cjeX4DR /9r4X7e0ODFRRhP2RJ7o/ReXFUCbuz0PmkFcl8OgwYoittpsif1SjHTtR332gvZE2 X-Received: by 2002:a5d:4486:: with SMTP id j6mr3576914wrq.160.1640328615828; Thu, 23 Dec 2021 22:50:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnB/V+NKSRJlynLIJFaD0zigyJl2SJSRQ+vylJjh/EbE14JEDzdTC1gs9zrjD94P80yiZTrw== X-Received: by 2002:a5d:4486:: with SMTP id j6mr3576896wrq.160.1640328615575; Thu, 23 Dec 2021 22:50:15 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH v3 2/8] migration: Don't return for postcopy_chunk_hostpages() Date: Fri, 24 Dec 2021 14:49:54 +0800 Message-Id: <20211224065000.97572-3-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211224065000.97572-1-peterx@redhat.com> References: <20211224065000.97572-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: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, 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: David Edmondson , "Dr . David Alan Gilbert" , Leonardo Bras Soares Passos , peterx@redhat.com, Juan Quintela 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: 1640329027804100001 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. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- migration/ram.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 7d9c8a508b..0ed0f51a09 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2580,12 +2580,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 @@ -2595,7 +2593,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 /** @@ -2617,7 +2614,6 @@ int ram_postcopy_send_discard_bitmap(MigrationState *= ms) { RAMState *rs =3D ram_state; RAMBlock *block; - int ret; =20 RCU_READ_LOCK_GUARD(); =20 @@ -2631,10 +2627,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:14 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 1640329209729489.552021024497; Thu, 23 Dec 2021 23:00:09 -0800 (PST) Received: from localhost ([::1]:47394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0eYd-0007F4-T8 for importer@patchew.org; Fri, 24 Dec 2021 02:00:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePJ-0001DX-Oy for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48468) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePH-0005nu-NE for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:25 -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-618-ul1B1V_5MRugxMqZFpzkDA-1; Fri, 24 Dec 2021 01:50:21 -0500 Received: by mail-wr1-f70.google.com with SMTP id l13-20020adfbd8d000000b001a23a990dbfso1469196wrh.5 for ; Thu, 23 Dec 2021 22:50:21 -0800 (PST) Received: from localhost.localdomain ([64.64.123.8]) by smtp.gmail.com with ESMTPSA id h14sm2174425wmq.16.2021.12.23.22.50.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 22:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640328623; 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=rrllebeXjhwn2QrPCOBd7fyW3DoTWKpL8HkzryqB5PE=; b=XwGOHKYIHAd8XZ1beelV532iu86FMKmO1AeyEMRCiYPxo8Wjr9+6DI+eYYFZIq1z1ZLd3L 3M2hsbfKVymR8796A539F39IwmI8x8+uwakEmzE54cZt7Bj/Qcbxt2ShPwiHvipgZEbQh8 11GQ3pKbmL7GD6qvv+kXyYSPICtMQEU= X-MC-Unique: ul1B1V_5MRugxMqZFpzkDA-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=rrllebeXjhwn2QrPCOBd7fyW3DoTWKpL8HkzryqB5PE=; b=hq2dH+D6XNv5K7ONq6110iIbuFe2TeUo+KjrovB9fcCzkJUDO7Zp2g2MvUbadGIIBj j3j4njJCsHEyybIbi8Vy+aUmZF1wc99atrZfCeL8NHzTij35rbVxOaf4vNLLHIb2Z7t1 HlN687jXwVHN+gMJWlnHxHjnH34utwkjIzqiK65QdsjvDfN2deKEbOKrnDUQUTNOLPCT eo5Jnem9+xrKKnXmZzYbjAIiLqlrDqMctjKIC+3Wre7ZqYUceg0671n0KmZZzhU25F8n pV+l/+bDvk5cmAQVUmWSCOjtQAmhvmySZX9qS897IJ7eRsASNck5cQy5eudiaMTAFd8v aYQQ== X-Gm-Message-State: AOAM530KNjuM2+TURdg5mtKY9roMMaDyfRXQMfz56XoU9XEaA/re+GGl +LfeAiKmlxCUJs4HdGcCROO4MVnspRphZWTNxQZGnXDZ3zM+5AVRbMocnGgSvU36sEC7KZxG/Pb /hpA7juswEzB1di98q5Vy6dYA3oKBiOec26JV30XLw0efrHPwuJZiauzJP9GXGfeh X-Received: by 2002:adf:d1c1:: with SMTP id b1mr3640405wrd.491.1640328619377; Thu, 23 Dec 2021 22:50:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSTfPVGA0gFC+njE7RG4tza0n50ksPk6LBb7B80CyfjOboEtpjKOVpYJFPavipqi9zAgHSBg== X-Received: by 2002:adf:d1c1:: with SMTP id b1mr3640388wrd.491.1640328619164; Thu, 23 Dec 2021 22:50:19 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH v3 3/8] migration: Drop postcopy_chunk_hostpages() Date: Fri, 24 Dec 2021 14:49:55 +0800 Message-Id: <20211224065000.97572-4-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211224065000.97572-1-peterx@redhat.com> References: <20211224065000.97572-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: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, 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: David Edmondson , "Dr . David Alan Gilbert" , Leonardo Bras Soares Passos , peterx@redhat.com, Juan Quintela 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: 1640329211532100001 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. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/ram.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 0ed0f51a09..b22c9e7432 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2571,30 +2571,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 * @@ -2626,8 +2602,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:14 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 1640329190611961.5817613270096; Thu, 23 Dec 2021 22:59:50 -0800 (PST) Received: from localhost ([::1]:46816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0eYP-0006pw-GV for importer@patchew.org; Fri, 24 Dec 2021 01:59:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePO-0001Ex-SS for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:51520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePN-0005qr-66 for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:30 -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-223-jNcZoPwrPe25UfuRWG1OUA-1; Fri, 24 Dec 2021 01:50:25 -0500 Received: by mail-wr1-f70.google.com with SMTP id d6-20020adfa346000000b001a262748c6fso1456461wrb.12 for ; Thu, 23 Dec 2021 22:50:25 -0800 (PST) Received: from localhost.localdomain ([64.64.123.8]) by smtp.gmail.com with ESMTPSA id h14sm2174425wmq.16.2021.12.23.22.50.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 22:50:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640328628; 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=cyB9NjacjlViYjX38NHa/38VGrRySbWUkQ8f+Gv2qv8=; b=JKATMn6Bo3WshsOotgkT75AQv/PpOwkQZ2elw90C++6Qt0zwywhz5Krek/etbgCJ4XRMUJ NVgEyp24oaok2Z9fc1nTmZMceoB0e57lyiK4qdmjBcuanQpfDTZKc5m9KiZrvaMAIhO7Np VI2QgKjXCaCqjJWtGE9wiQPNCTb2p54= X-MC-Unique: jNcZoPwrPe25UfuRWG1OUA-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=cyB9NjacjlViYjX38NHa/38VGrRySbWUkQ8f+Gv2qv8=; b=I053ym8S8DYXfqOpdTmfTTuhnPYBPUWMbunM7NqMkrbEGK1rxGYDP+Op6nqu6h6cET 7YgFivn3rRq9T+vMSCrV+Dg/Zw3nKr7ftynfDlXRul8SlahUNay5F5as/Lrmj0LM2iM5 oPRIfKiyCGsyMyssxRHjfrZA0kMjwO/i3M1Zay3G6DWxzMblogaa+lFkmWmkbDtgq//t wi25rV8uB0A3rqFzeIut7ZJSyrGMpLRVD9mc3helg2dNRtUSWfHuEkqgEHst2cL4reOy ri6FllD/K4p9kIUUPo1lob4+kKxuyBQiCajNMBG1xq4R1cTa+j455hvwE4eM2wRIMgWZ /8Eg== X-Gm-Message-State: AOAM5334ySalqL1dM24pq+5H/O5y7XNocmOOhhE2hLav1K/bNi23N5U5 2iR5+S9QFUR/7c9kWz7e3g+OJO12QlDKVsQ/YfGphEaGvvPAc/+CHG1U5xxag2PaOF3qYnhAfrp EWjgRlbSHwxdXSqrl6bah553r9eb44jrsTJ4IwVhC6AuUslNT1bFMGmyg+n3NXNWb X-Received: by 2002:a05:6000:1688:: with SMTP id y8mr3605167wrd.682.1640328622851; Thu, 23 Dec 2021 22:50:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJx16/UczdE0/D19uInJDdFoEimiuvyGmjUSPKqqa2VKuL3o75LMi/V+wWKy/7Eblfbv/S+r0g== X-Received: by 2002:a05:6000:1688:: with SMTP id y8mr3605156wrd.682.1640328622636; Thu, 23 Dec 2021 22:50:22 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH v3 4/8] migration: Do chunk page in postcopy_each_ram_send_discard() Date: Fri, 24 Dec 2021 14:49:56 +0800 Message-Id: <20211224065000.97572-5-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211224065000.97572-1-peterx@redhat.com> References: <20211224065000.97572-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: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, 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: David Edmondson , "Dr . David Alan Gilbert" , Leonardo Bras Soares Passos , peterx@redhat.com, Juan Quintela 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: 1640329192801100001 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. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu --- migration/ram.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index b22c9e7432..e7107b9790 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2468,6 +2468,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 * @@ -2489,6 +2491,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 @@ -2589,7 +2599,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 @@ -2601,15 +2610,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:14 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 1640329623408123.14881659670186; Thu, 23 Dec 2021 23:07:03 -0800 (PST) Received: from localhost ([::1]:56016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0efO-0004mT-5i for importer@patchew.org; Fri, 24 Dec 2021 02:07:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePO-0001Ew-SS for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePN-0005qt-5y for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:30 -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-563-SDp_yFpbN5iKsk8drumz2Q-1; Fri, 24 Dec 2021 01:50:27 -0500 Received: by mail-wr1-f72.google.com with SMTP id t30-20020adfa2de000000b001a24004e1fbso1461146wra.10 for ; Thu, 23 Dec 2021 22:50:27 -0800 (PST) Received: from localhost.localdomain ([64.64.123.8]) by smtp.gmail.com with ESMTPSA id h14sm2174425wmq.16.2021.12.23.22.50.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 22:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640328628; 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=VwMIb7HX3Rilfemmu/NF48gq/klN+qs16FNWRwHcUuw=; b=jE106rajmPyn4Xd+YPzVCPCFp0Koce39FgsKMnQAztdNZmX/c0hUGEBiNM+lbpu5VwULey 5uDin8p/iL4tfMAkiRIOJMPy0/Bj15E/K0uchlvkqz+MyJLQWK8+mJKAGJP7E7YE5N3qB5 Au1zwe+NVbKIpD1RSwARDQ7VinV9MRA= X-MC-Unique: SDp_yFpbN5iKsk8drumz2Q-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=VwMIb7HX3Rilfemmu/NF48gq/klN+qs16FNWRwHcUuw=; b=sg7bzUAhv3SAsVyGPH2jnYUBncBVsmySbZbg5N7qyMPlQZxPQ2lOX7kJlODtUiinIG 9MSbYaot+j78FmpgffGugCfs+fXkqprBWnMQbwi2ud95VaEYvyx6O/mdFNpoKRbWrRRi weL/I02dOd1WaGcF8sSjTiek/YzUM68traMKVi4MnyST3UcmqAQ8ogn4WABe6SSJj3/F gPMqvs1KvxfQyQpMX+HB0RfPwVdBSD6OUVAE+Qj/UkY5pUmVdDWZ8exDu5jM6RAhap61 EaRIes0NrXa3GnZ5rD+AixPcbU2dLy9ozpModhTCDaai0ekMA6+ibBjJB8x8UBWhAgvE /e4g== X-Gm-Message-State: AOAM533bnMm4tQCCSZT98sZRhA0wVebmDDLcYgPZoI2MTg2j55OHUSFx C1la5I5+bA9HO/igmmatJYxhGUkbXcdh2ItT3yPqRzubjtTy/IM3mNQTkoulRgH5GPqXXRJeHjj XAn/KyER4EJ0zMk4lYd5Fn7Gka7/vdOYWqh+S74zKjd4nDF1ABvPPg8fcNZbnrxCj X-Received: by 2002:a5d:6d85:: with SMTP id l5mr3748350wrs.579.1640328626016; Thu, 23 Dec 2021 22:50:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhd2m1GxQJCGyY2VEDWMw5iI8DrgmLVOzVE7lOZjJHQw1q2EIghGpEgRl9hqzABlBAo1CaHA== X-Received: by 2002:a5d:6d85:: with SMTP id l5mr3748332wrs.579.1640328625758; Thu, 23 Dec 2021 22:50:25 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH v3 5/8] migration: Drop return code for disgard ram process Date: Fri, 24 Dec 2021 14:49:57 +0800 Message-Id: <20211224065000.97572-6-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211224065000.97572-1-peterx@redhat.com> References: <20211224065000.97572-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: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, 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: David Edmondson , "Dr . David Alan Gilbert" , Leonardo Bras Soares Passos , peterx@redhat.com, Juan Quintela 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: 1640329624871100001 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). Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 0652165610..252ce1eaec 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2991,10 +2991,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 e7107b9790..5234d1ece1 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2473,8 +2473,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. @@ -2483,10 +2481,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); @@ -2504,14 +2501,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 /** @@ -2584,8 +2576,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 @@ -2596,7 +2586,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 @@ -2610,9 +2600,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:14 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 164032943200356.55047040760212; Thu, 23 Dec 2021 23:03:52 -0800 (PST) Received: from localhost ([::1]:51748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0ecI-0001sD-TR for importer@patchew.org; Fri, 24 Dec 2021 02:03:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePS-0001Fk-Sa for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:54472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePR-0005rI-Am for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:34 -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-151-3CPvFvfENMiJvkLfek2UlQ-1; Fri, 24 Dec 2021 01:50:30 -0500 Received: by mail-wr1-f71.google.com with SMTP id d13-20020adf9b8d000000b001a2aa837f8dso1470541wrc.3 for ; Thu, 23 Dec 2021 22:50:30 -0800 (PST) Received: from localhost.localdomain ([64.64.123.8]) by smtp.gmail.com with ESMTPSA id h14sm2174425wmq.16.2021.12.23.22.50.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 22:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640328632; 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=f7+IaUs/ri/bBQ3wmEyPeRxPM6SAsBS5ON+zrdwGBIM=; b=SlSp0i3+RPk+2RmqjKotgVdX5ZAVO3UNlLsCPrctAMI+FHR/LujRYi0amC9+YKNgLBInAn Qm61qpySxrneW0CWO/z2caIiniynJ41sKoO5bsTuSD4aSRvgAPgCVOmZvVRYWk5CuSYMwY pMbD7fxjI5Hi4jeB+BT21f/G93YYO0s= X-MC-Unique: 3CPvFvfENMiJvkLfek2UlQ-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=f7+IaUs/ri/bBQ3wmEyPeRxPM6SAsBS5ON+zrdwGBIM=; b=Med/axj9sk15oNQxWznUODnVoQxNYV8uBI3Qk9rT/1cb7lKnIYEyattQ3TigAajIX/ m7RxVaMp/3mJt007py7+rG8KfplBgpQrXz0NmX7lOC/2g9QIgZdvkTfRBpkSMngSnibB /7blH5BCrAcl92HEek+cveZrQu/BS3InhyB8HRA8bYzatTMG0DnjJlmWpj98KdLmV6KI gMa8ExMO0ifhNwB2W6rTbps4ttVKBgVfGBnNGJe89HoVzWVdvXlrpRQaCYgdhqbHxORJ qtAY1lb7dfBsvZRyaKMTGBeXu113cYJGjkmfmpAUoF9C99B6b2MATAQmwlXmWH5ebOjh dmvw== X-Gm-Message-State: AOAM532C/unRYXulHUnIAEWy2a3hZftbqs4t+u6UOdzXKY2KJdo8OAf/ UUwp9AYoV5VrHEr/PvRt96lT3SiplZGU8rJeF86JIxXUrVQv/q8P06HZixhsRLGDjTv6Dc1X/2g kDjZfXqUOawfqFA1BwvhNg3LlJ944r7wZ3FWLeOZN+nKDeEiNHLM+D3mlHYp7as6R X-Received: by 2002:adf:e4ce:: with SMTP id v14mr3671337wrm.370.1640328629312; Thu, 23 Dec 2021 22:50:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhnFV8sqK/Eu+nN+9y5JGqQ+C8qwZcgDs+eIrFalQWkPGtjgz/YO/sJp4vk3PQKfZggpOa1A== X-Received: by 2002:adf:e4ce:: with SMTP id v14mr3671322wrm.370.1640328629089; Thu, 23 Dec 2021 22:50:29 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH v3 6/8] migration: Dump sub-cmd name in loadvm_process_command tp Date: Fri, 24 Dec 2021 14:49:58 +0800 Message-Id: <20211224065000.97572-7-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211224065000.97572-1-peterx@redhat.com> References: <20211224065000.97572-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: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, 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: David Edmondson , "Dr . David Alan Gilbert" , Leonardo Bras Soares Passos , peterx@redhat.com, Juan Quintela 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: 1640329434321100001 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 Reviewed-by: David Edmondson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- migration/savevm.c | 3 ++- migration/trace-events | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 0bef031acb..7f7af6f750 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2272,12 +2272,13 @@ static int loadvm_process_command(QEMUFile *f) return qemu_file_get_error(f); } =20 - trace_loadvm_process_command(cmd, 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; } =20 + trace_loadvm_process_command(mig_cmd_args[cmd].name, len); + if (mig_cmd_args[cmd].len !=3D -1 && mig_cmd_args[cmd].len !=3D len) { error_report("%s received with bad length - expecting %zu, got %d", mig_cmd_args[cmd].name, 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:14 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 1640330165069983.1664558005405; Thu, 23 Dec 2021 23:16:05 -0800 (PST) Received: from localhost ([::1]:35994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0eo7-0002h3-2m for importer@patchew.org; Fri, 24 Dec 2021 02:16:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePW-0001HR-Mj for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePU-0005rn-Kn for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:38 -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-354-ZH_6N2crN9Wc3ELJYNMgdg-1; Fri, 24 Dec 2021 01:50:35 -0500 Received: by mail-wr1-f71.google.com with SMTP id g6-20020adfbc86000000b001a2d62be244so198138wrh.23 for ; Thu, 23 Dec 2021 22:50:34 -0800 (PST) Received: from localhost.localdomain ([64.64.123.8]) by smtp.gmail.com with ESMTPSA id h14sm2174425wmq.16.2021.12.23.22.50.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 22:50:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640328636; 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=hO2VHwlCtcwC9haiRz47Ykb5e10MbUd3MeIMMTeaYZE=; b=cZgGNqeelV6jP7BvvrZ/uPLGrK9S6CWLv6XwP6IHtUwKZo0B19o5mKUiJF8lfgxwm74LCb vzSnyiuwcFF5BEvv9bQWq6bnRuhSfnUEXjTIMeaKTGXGjlHt/GZzvdoHPWqFpVO1TZB3JZ XBn/95UznBWT2BKhWX0TtK7MiyjC8xI= X-MC-Unique: ZH_6N2crN9Wc3ELJYNMgdg-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=hO2VHwlCtcwC9haiRz47Ykb5e10MbUd3MeIMMTeaYZE=; b=TMNMcCYU9VM+cKufLSyZ1+ejh6y1R/nexVfcwyzKpQCqztggZiu9Y5xmjhtFKV5fCo zzxH+KEtFRDFC1nJHTwViJrhqc+b1jOwDusa5aGm3e+8KzDS3fkySiTcccd0CtCW/+Ky eWx+RxditZC+6wPvl8fV/xhNnD42J9aJ+bcXbFAHruQdgduf8zZ0dMf51Dh7AS2gOugi Mxatxpei2FOou2T+8/wX7lC2VEfTRZmf3jlAKrgmXlY+YKQn9Eh8M3bhV9QF0Va0Efz4 UwBN4r66J5/eq81JqEj58S25+TgXaQ8daDi91imcIARzER8vDGmvPKf/9j4BeKXF1n07 686g== X-Gm-Message-State: AOAM532hpQrZGOwujKBfR3gBnumTt/EWFjUwJ4AJT2ybsi+szUlCRBFp QW1P0Dez9iFQNL1LPLAO5jBOkpdb/zR51fwAyh7q13LV6j6DLL2+DNgXXvY+sox5BLh59POZm/U EY1XS7l3wbLgSWIRR3WcXfZiQX7uO5/zz6PY9NSUJq0laxa+1YxjcclUxbsXe+JDN X-Received: by 2002:a5d:6d06:: with SMTP id e6mr3686801wrq.273.1640328632687; Thu, 23 Dec 2021 22:50:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRRE7FEFbYJNiczObfajq/dsyoLBSeiXltAAyvN9QAzCW3sEMoIk/xxjE7KiU8xwd0NJquyQ== X-Received: by 2002:a5d:6d06:: with SMTP id e6mr3686791wrq.273.1640328632480; Thu, 23 Dec 2021 22:50:32 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH v3 7/8] migration: Finer grained tracepoints for POSTCOPY_LISTEN Date: Fri, 24 Dec 2021 14:49:59 +0800 Message-Id: <20211224065000.97572-8-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211224065000.97572-1-peterx@redhat.com> References: <20211224065000.97572-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: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, 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: David Edmondson , "Dr . David Alan Gilbert" , Leonardo Bras Soares Passos , peterx@redhat.com, Juan Quintela 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: 1640330167571100001 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 Reviewed-by: David Edmondson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- migration/savevm.c | 9 ++++++++- migration/trace-events | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 7f7af6f750..592d550a2f 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1947,9 +1947,10 @@ 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(); Error *local_err =3D NULL; =20 + trace_loadvm_postcopy_handle_listen("enter"); + if (ps !=3D POSTCOPY_INCOMING_ADVISE && ps !=3D POSTCOPY_INCOMING_DISC= ARD) { error_report("CMD_POSTCOPY_LISTEN in wrong postcopy state (%d)", p= s); return -1; @@ -1964,6 +1965,8 @@ static int loadvm_postcopy_handle_listen(MigrationInc= omingState *mis) } } =20 + trace_loadvm_postcopy_handle_listen("after discard"); + /* * Sensitise RAM - can now generate requests for blocks that don't exi= st * However, at this point the CPU shouldn't be running, and the IO @@ -1976,6 +1979,8 @@ static int loadvm_postcopy_handle_listen(MigrationInc= omingState *mis) } } =20 + trace_loadvm_postcopy_handle_listen("after uffd"); + if (postcopy_notify(POSTCOPY_NOTIFY_INBOUND_LISTEN, &local_err)) { error_report_err(local_err); return -1; @@ -1990,6 +1995,8 @@ static int loadvm_postcopy_handle_listen(MigrationInc= omingState *mis) qemu_sem_wait(&mis->listen_thread_sem); qemu_sem_destroy(&mis->listen_thread_sem); =20 + trace_loadvm_postcopy_handle_listen("return"); + return 0; } =20 diff --git a/migration/trace-events b/migration/trace-events index d63a5915f5..77d1237d89 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(const char *str) "%s" loadvm_postcopy_handle_run(void) "" loadvm_postcopy_handle_run_cpu_sync(void) "" loadvm_postcopy_handle_run_vmstart(void) "" --=20 2.32.0 From nobody Sat May 18 10:57:14 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 1640329615836250.52988683966112; Thu, 23 Dec 2021 23:06:55 -0800 (PST) Received: from localhost ([::1]:55452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0efG-0004OE-HO for importer@patchew.org; Fri, 24 Dec 2021 02:06:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePY-0001IY-OV for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0ePX-0005s8-7R for qemu-devel@nongnu.org; Fri, 24 Dec 2021 01:50:40 -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-252-y40iUgLBPpO3NgLf5o0jeg-1; Fri, 24 Dec 2021 01:50:37 -0500 Received: by mail-wr1-f71.google.com with SMTP id l13-20020adfbd8d000000b001a23a990dbfso1469461wrh.5 for ; Thu, 23 Dec 2021 22:50:37 -0800 (PST) Received: from localhost.localdomain ([64.64.123.8]) by smtp.gmail.com with ESMTPSA id h14sm2174425wmq.16.2021.12.23.22.50.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Dec 2021 22:50:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640328638; 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=+enMLVlcylOm8RcSTo9530m2haG9qkSll4HC4NkeZ3U=; b=QC2m0v4zO48WqQbJXct7d72p6SwnoGR8pdhMwC9lEc5bLXetIssmPM+eNcp7XEXfpOvvdS EBcWKdL/1VIRhcDqZw99lTzEk+M63TTX2eV4KxYD+qBT9ZQ+djNliThbDfZpyCPOwhhKsk /ktnqJfVtiPiM5HBTtqOjanMJRh/yU0= X-MC-Unique: y40iUgLBPpO3NgLf5o0jeg-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=+enMLVlcylOm8RcSTo9530m2haG9qkSll4HC4NkeZ3U=; b=0/8NnsNUE7QV8fnatBGGzvirUPOyfb7YGofGYwkSKP7h8m9tCevhEccjh1lwGVi2Sq Jb3pIBgzVOWABNYaGSb/fLGp0qt0jOq2cNMk4WR7svZXwtOPP8HRxBk2YvmsfgXYQdKi Rt8Wl1ORx6Oe8rn/udwwbecnjV22KygwKM5s86zs0oO+r7mBBYcG1cj2HwKC4wMY+NKi qjtnbEreUD+TFK87IOMH7WSGlt+uQBlNQsxG6jeb8vkmKZTGj7x4IUeL8A+QWK3dWXwW x59j7CEpRNeWg2/6a+j0AxTf60SR5C/uKcoJfKSl4YtVfN9gua9mmLUBvArfG2WD+z9r ig3Q== X-Gm-Message-State: AOAM533pJkzTVLEOonQh+j3NouTRqmp4kIgU5VwFPsWjSGlarUV8uVgP GwWMvzNar624r2sAX1Pwt/zwkf7KjqurUCr9UT64BczN8G71GGtK+amzl0TeHiHhjaqwj2PpvuX KhtQsR1I94RU0NKACr4aPs/Y+GB3cU0fkLC5wRdwHpmqKGNz9fViuwkW8gxxsgeNm X-Received: by 2002:a05:600c:1f0c:: with SMTP id bd12mr3765762wmb.82.1640328636128; Thu, 23 Dec 2021 22:50:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsBOkfhJZrxOiO3h9psvPKQtNi91Jp3gtQKaWaoLIwO75VMYvRINchx1v8CG2zzbIMqzd41A== X-Received: by 2002:a05:600c:1f0c:: with SMTP id bd12mr3765747wmb.82.1640328635847; Thu, 23 Dec 2021 22:50:35 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH v3 8/8] migration: Tracepoint change in postcopy-run bottom half Date: Fri, 24 Dec 2021 14:50:00 +0800 Message-Id: <20211224065000.97572-9-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211224065000.97572-1-peterx@redhat.com> References: <20211224065000.97572-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: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.203, 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: David Edmondson , "Dr . David Alan Gilbert" , Leonardo Bras Soares Passos , peterx@redhat.com, Juan Quintela 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: 1640329617962100001 Content-Type: text/plain; charset="utf-8" Remove the old two tracepoints and they're even near each other: trace_loadvm_postcopy_handle_run_cpu_sync() trace_loadvm_postcopy_handle_run_vmstart() Add trace_loadvm_postcopy_handle_run_bh() with a finer granule trace. Signed-off-by: Peter Xu Reviewed-by: David Edmondson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- migration/savevm.c | 12 +++++++++--- migration/trace-events | 3 +-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 592d550a2f..3b8f565b14 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2005,13 +2005,19 @@ static void loadvm_postcopy_handle_run_bh(void *opa= que) Error *local_err =3D NULL; MigrationIncomingState *mis =3D opaque; =20 + trace_loadvm_postcopy_handle_run_bh("enter"); + /* TODO we should move all of this lot into postcopy_ram.c or a shared= code * in migration.c */ cpu_synchronize_all_post_init(); =20 + trace_loadvm_postcopy_handle_run_bh("after cpu sync"); + qemu_announce_self(&mis->announce_timer, migrate_announce_params()); =20 + trace_loadvm_postcopy_handle_run_bh("after announce"); + /* Make sure all file formats flush their mutable metadata. * If we get an error here, just don't restart the VM yet. */ bdrv_invalidate_cache_all(&local_err); @@ -2021,9 +2027,7 @@ static void loadvm_postcopy_handle_run_bh(void *opaqu= e) autostart =3D false; } =20 - trace_loadvm_postcopy_handle_run_cpu_sync(); - - trace_loadvm_postcopy_handle_run_vmstart(); + trace_loadvm_postcopy_handle_run_bh("after invalidate cache"); =20 dirty_bitmap_mig_before_vm_start(); =20 @@ -2036,6 +2040,8 @@ static void loadvm_postcopy_handle_run_bh(void *opaqu= e) } =20 qemu_bh_delete(mis->bh); + + trace_loadvm_postcopy_handle_run_bh("return"); } =20 /* After all discards we can start running and asking for pages */ diff --git a/migration/trace-events b/migration/trace-events index 77d1237d89..e165687af2 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -16,8 +16,7 @@ loadvm_handle_recv_bitmap(char *s) "%s" loadvm_postcopy_handle_advise(void) "" loadvm_postcopy_handle_listen(const char *str) "%s" loadvm_postcopy_handle_run(void) "" -loadvm_postcopy_handle_run_cpu_sync(void) "" -loadvm_postcopy_handle_run_vmstart(void) "" +loadvm_postcopy_handle_run_bh(const char *str) "%s" loadvm_postcopy_handle_resume(void) "" loadvm_postcopy_ram_handle_discard(void) "" loadvm_postcopy_ram_handle_discard_end(void) "" --=20 2.32.0