From nobody Mon Feb 9 05:18:59 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1664908111; cv=none; d=zohomail.com; s=zohoarc; b=TFiQxK4gG1A7J0/OaIEz8HNwbpnbtiim6e1q7VjhLpwmqwoMZCb9WcX8d86pW0lYqv5oQDyWeYVIQr+IH1sl9EPIRcL9bUWg31tDto1XCa4E+w3CjyJiFodsfTwwwbkgjgzarDfrWncchEMgo6lNHHkHBVvAHNX1TrV5bKGbOk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664908111; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kuI0g2SiMu8yyfxOSQmN2tHqirIL8PEq/zBM9j5AHm4=; b=Bvo8fTdikFUJS7qt5SVF4S46qsFR2jaPJIhU///+5txMQYY2NWaqVf9lUQO47dxot/4aMde/OaugQlC2VaTOuclHtXYsRm4vT1CBsBy2U/XJBpOv6pFbocuBEKa5O50suO+7yHpfLFCH2Hca2yLX4wS2kLFKRZGImCp2gv/LneQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664908111483724.0014555350876; Tue, 4 Oct 2022 11:28:31 -0700 (PDT) Received: from localhost ([::1]:46464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofmeW-0001JN-4K for importer@patchew.org; Tue, 04 Oct 2022 14:28:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofmb3-0007Sq-A3 for qemu-devel@nongnu.org; Tue, 04 Oct 2022 14:24:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:35700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofmax-0005fF-7i for qemu-devel@nongnu.org; Tue, 04 Oct 2022 14:24:46 -0400 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-351-ecc3KnR8MJ2owOsyE1S97Q-1; Tue, 04 Oct 2022 14:24:38 -0400 Received: by mail-qv1-f72.google.com with SMTP id m7-20020a0ce6e7000000b004ad69308f01so9263591qvn.9 for ; Tue, 04 Oct 2022 11:24:38 -0700 (PDT) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-46-70-31-27-79.dsl.bell.ca. [70.31.27.79]) by smtp.gmail.com with ESMTPSA id i1-20020ac813c1000000b0035c1e18762csm12334514qtj.84.2022.10.04.11.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 11:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664907879; 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=kuI0g2SiMu8yyfxOSQmN2tHqirIL8PEq/zBM9j5AHm4=; b=dU4pVsmgdMLe0UjOWi6jZ3D+Bui+PSKr25c1udpfqzumwrVXVT4+p6ThDV/HPaYhDUs13m 2SXA44PLAK5PPEi74fEySF+TyMagh2CBbdnizl1LjS7FLciDgKgUIln1v0WFunfjg37cQD Lc39UKd60DxaMFH0MdPlxIxySauO928= X-MC-Unique: ecc3KnR8MJ2owOsyE1S97Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=kuI0g2SiMu8yyfxOSQmN2tHqirIL8PEq/zBM9j5AHm4=; b=z+LN3ibLNz2Uk/1uj1mFbyzRXCXFwsnsI9CdLRUFituZrl+zJSZcSmz6Zp6az6K8NC GXKnwjxBtF2weqc0t7hiIaA/8iU+MN1CrQ8TgQXakseYjgFOp5rt7ETrNzHnkoSqx4lJ A6yzZhR/pRE0pq9y+4Fh1ICd9JcSa/dFu11uTs2S0hano2ilhfORyjRupCIs2SRQ9cao iapnk4h7303wsYWhnO9DTT4sO91d8ce7izc2HGJJWJTnbaftJicr7jivLC8Iez9ZQJRu urstmoeWAgVr+ijXoS5qECtXDvgYc1J8SZqGr1N5uPzU4cyOq3WFkf2uOmxXNpoaxddM sBfg== X-Gm-Message-State: ACrzQf2bMCjIWwohmERuDzTkhK7NYdWqi4kFr1BN81mEQ6wWCrS1Ouug imS4fkkjzVYY17Jdd2TIZxq+BQ11YT8+TIr7ceriZM71irOcUu8groSzJ2LraIqjpkw4a0EIxPP jkdONXZwMNJolYIkK2XNzuONMXNe6BqBQ6T1GR3PleA3W80tIeFTsdDBapt6L8qtB X-Received: by 2002:a05:6214:242d:b0:4b1:862f:49e0 with SMTP id gy13-20020a056214242d00b004b1862f49e0mr10411674qvb.65.1664907878064; Tue, 04 Oct 2022 11:24:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4DVufVW3ehnQey8eIKTIn9T4R7oyyfVSBGpKdCbrPzQdV/UTuB3/mxFENOoAPJiZkGKGAQ/w== X-Received: by 2002:a05:6214:242d:b0:4b1:862f:49e0 with SMTP id gy13-20020a056214242d00b004b1862f49e0mr10411659qvb.65.1664907877809; Tue, 04 Oct 2022 11:24:37 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: "Daniel P . Berrange" , Leonardo Bras Soares Passos , "Dr . David Alan Gilbert" , peterx@redhat.com, Juan Quintela Subject: [PATCH v2 5/5] migration: Disable multifd explicitly with compression Date: Tue, 4 Oct 2022 14:24:30 -0400 Message-Id: <20221004182430.97638-6-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221004182430.97638-1-peterx@redhat.com> References: <20221004182430.97638-1-peterx@redhat.com> MIME-Version: 1.0 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: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664908113526100001 Content-Type: text/plain; charset="utf-8" Multifd thread model does not work for compression, explicitly disable it. Note that previuosly even we can enable both of them, nothing will go wrong, because the compression code has higher priority so multifd feature will just be ignored. Now we'll fail even earlier at config time so the user should be aware of the consequence better. Note that there can be a slight chance of breaking existing users, but let's assume they're not majority and not serious users, or they should have found that multifd is not working already. With that, we can safely drop the check in ram_save_target_page() for using multifd, because when multifd=3Don then compression=3Doff, then the removed check on save_page_use_compression() will also always return false too. Signed-off-by: Peter Xu --- migration/migration.c | 7 +++++++ migration/ram.c | 11 +++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 844bca1ff6..ef00bff0b3 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1349,6 +1349,13 @@ static bool migrate_caps_check(bool *cap_list, } } =20 + if (cap_list[MIGRATION_CAPABILITY_MULTIFD]) { + if (cap_list[MIGRATION_CAPABILITY_COMPRESS]) { + error_setg(errp, "Multifd is not compatible with compress"); + return false; + } + } + return true; } =20 diff --git a/migration/ram.c b/migration/ram.c index 1d42414ecc..1338e47665 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2305,13 +2305,12 @@ static int ram_save_target_page(RAMState *rs, PageS= earchStatus *pss) } =20 /* - * Do not use multifd for: - * 1. Compression as the first page in the new block should be posted = out - * before sending the compressed page - * 2. In postcopy as one whole host page should be placed + * Do not use multifd in postcopy as one whole host page should be + * placed. Meanwhile postcopy requires atomic update of pages, so even + * if host page size =3D=3D guest page size the dest guest during run = may + * still see partially copied pages which is data corruption. */ - if (!save_page_use_compression(rs) && migrate_use_multifd() - && !migration_in_postcopy()) { + if (migrate_use_multifd() && !migration_in_postcopy()) { return ram_save_multifd_page(rs, block, offset); } =20 --=20 2.37.3