From nobody Mon Feb 9 05:19:05 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=1661792418; cv=none; d=zohomail.com; s=zohoarc; b=fJg9QfSWgyd6EhhxVks6NUEbjosLnNugnf643tDxRyeCpRw07MCivahnNY3gmS1/Ny75KIZ1PyQsrx7LcJszQPjgTEbe8Dh4wUgQ/IKRwr9tnT8AoEnCmsKcfajDJYpnTILAtjBK2qFIy9t8yJRf3NKt6tQGYR4fo2OZHmL++CY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661792418; 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=rgr99bIWyM5L4P9pc8hfhC39aU33CUh7xyLzYjt26gI=; b=hqiBR+Fai4sWAc1MjSLNUnJWiVI9+XSr58bgkyZCKyTKStoVLh9tlaQHJftuF1caiqmcN7iklHdhY0qAsjrB6XWuNZJjf0IDC+7t8XDRBHM4ivw7cxBdrV3jY5/Qgb+Wim8PHuNC+QtSux2Sj/349F1VZ3GX5RGX+6LLtxJvD7Y= 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 1661792418725126.79195421110694; Mon, 29 Aug 2022 10:00:18 -0700 (PDT) Received: from localhost ([::1]:39528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSi7V-0005OU-Fk for importer@patchew.org; Mon, 29 Aug 2022 13:00:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSi4X-0002d7-II for qemu-devel@nongnu.org; Mon, 29 Aug 2022 12:57:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40114) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSi4V-0008Fg-HB for qemu-devel@nongnu.org; Mon, 29 Aug 2022 12:57:13 -0400 Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-542-h9Ay70-BOZm47rYEAzDrWA-1; Mon, 29 Aug 2022 12:57:07 -0400 Received: by mail-il1-f198.google.com with SMTP id k9-20020a056e021a8900b002e5bd940e96so6334815ilv.13 for ; Mon, 29 Aug 2022 09:57:07 -0700 (PDT) Received: from localhost.localdomain (bras-base-aurron9127w-grc-35-70-27-3-10.dsl.bell.ca. [70.27.3.10]) by smtp.gmail.com with ESMTPSA id y9-20020a056638228900b00344c3de5ec7sm4404709jas.150.2022.08.29.09.57.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Aug 2022 09:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661792228; 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=rgr99bIWyM5L4P9pc8hfhC39aU33CUh7xyLzYjt26gI=; b=N2ylz5kxbfKJOpDOKF+dluTfqTyMg3BU5Blbqvw8/57vb+daiWP3gWlKkpbpXu2/waAOQK oxihFl6MmmvdLZPY8h+hYR42PtNOsyBee0nQYXukKGoENmv/6RCT7kzv6zZ6tJ6eMib4SE Zl/Oqfwllw3MlWdnk3ss9QaGLj0AQXQ= X-MC-Unique: h9Ay70-BOZm47rYEAzDrWA-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; bh=rgr99bIWyM5L4P9pc8hfhC39aU33CUh7xyLzYjt26gI=; b=fQ9NpN9fyRCyx/TbViHp5IGmJYoWj5Ea/WaqsgJEuHkZyEVxAk+6vw8yhuY6+GnOQL AyuDYW+xiD2NRT/F9P2oA3toquxALJTtHe2ETRLvUKERQmwBz48ATTSTVbifagmuSwWf u6QVG62geOVvqisDVpVPFXL+aeRiTTBi8ClfRngohxPjR+/wQfWOIS5HY0jjm+SoiE5L nq0qBNkinK9NhVMsuIodL2kWNtw5mPK8vBsm1qE9kInnOOkIWuShBw4HUIJJHPSc6Jjg HypBI1CsCb766G+hQkSXNxTECFZTvF/tpE9LfG3wkjVf3OdjPhjbT2Fo1c7Cbx679gjZ 0yag== X-Gm-Message-State: ACgBeo286ubD4bD7ukg5TVyWTntlJ9PYLaSEA/QEJTIn/Tbeub7A9KS+ 8lLvb0q2TPDDm/k5j9Fj94qU3It8GXaXdsGfn9yn6BSD+ha3/LxdqL7kw+Zd5AY+J76fmfZhnTX 7i9+Bc868i1fvAAKJ9SiJsyvocFTTdku6QdBvv5Yjpgke6Pf3jbgDtDVcBmZkF9zq X-Received: by 2002:a05:6e02:923:b0:2eb:2f46:c97 with SMTP id o3-20020a056e02092300b002eb2f460c97mr1781854ilt.116.1661792226233; Mon, 29 Aug 2022 09:57:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR4YO8x2Mhi4UUg5anPTnYKI/M25Hhf/KcwIhMUouNhOfnK3HQItrU8NZO5cakBCFTtPoI2V/A== X-Received: by 2002:a05:6e02:923:b0:2eb:2f46:c97 with SMTP id o3-20020a056e02092300b002eb2f460c97mr1781841ilt.116.1661792226041; Mon, 29 Aug 2022 09:57:06 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: "Daniel P . Berrange" , Leonardo Bras Soares Passos , Manish Mishra , Juan Quintela , "Dr . David Alan Gilbert" , peterx@redhat.com Subject: [PATCH RFC 02/13] migration: Add postcopy_preempt_active() Date: Mon, 29 Aug 2022 12:56:48 -0400 Message-Id: <20220829165659.96046-3-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220829165659.96046-1-peterx@redhat.com> References: <20220829165659.96046-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.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1661792419697100001 Content-Type: text/plain; charset="utf-8" Add the helper to show that postcopy preempt enabled, meanwhile active. Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index dc1de9ddbc..8c5d5332e8 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -162,6 +162,11 @@ out: return ret; } =20 +static bool postcopy_preempt_active(void) +{ + return migrate_postcopy_preempt() && migration_in_postcopy(); +} + bool ramblock_is_ignored(RAMBlock *block) { return !qemu_ram_is_migratable(block) || @@ -2434,7 +2439,7 @@ static void postcopy_preempt_choose_channel(RAMState = *rs, PageSearchStatus *pss) /* We need to make sure rs->f always points to the default channel elsewhe= re */ static void postcopy_preempt_reset_channel(RAMState *rs) { - if (migrate_postcopy_preempt() && migration_in_postcopy()) { + if (postcopy_preempt_active()) { rs->postcopy_channel =3D RAM_CHANNEL_PRECOPY; rs->f =3D migrate_get_current()->to_dst_file; trace_postcopy_preempt_reset_channel(); @@ -2472,7 +2477,7 @@ static int ram_save_host_page(RAMState *rs, PageSearc= hStatus *pss) return 0; } =20 - if (migrate_postcopy_preempt() && migration_in_postcopy()) { + if (postcopy_preempt_active()) { postcopy_preempt_choose_channel(rs, pss); } =20 --=20 2.32.0