From nobody Sat Nov 23 22:36:42 2024 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=fail(p=none dis=none) header.from=smartx.com ARC-Seal: i=1; a=rsa-sha256; t=1731128470; cv=none; d=zohomail.com; s=zohoarc; b=IuRBSb5A8dORfCH32jDANj9azH2f5wZYbbcc2AUDSB4TBjq71C/eLyRAnSPFGOGJibgQgvNGYJubDf57FJG5/LyTiEefWlAROBLyjZ/3xpMRn2zAWjRfxb1jkbC7447YS40Jdik2WS0aLT07JEx5DyykHsJhNqiYAAT8GIQyeOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731128470; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pe8SBHoLAZphIXqOGJa/qUqOysZpgdOltfKYUVIh7vA=; b=ggRAJpz8ZDEgfi+MUofWlLt6BpRe40LihPtE+coAq5OFAv5VHzdqwTCbAAxqGNOvSkYIwiQhuTqGh19gVtWfBZN6duVSuqs3PP3tdlW1Wo6LWM9UO09G8SXoB3sXc1hbYaXG+6ECzEL5aGFrN4MeoQpS9bLecqfQ6fmg5PRzwaU= 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=fail 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 1731128470170831.5173804312784; Fri, 8 Nov 2024 21:01:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9dZl-0006Nj-Ey; Fri, 08 Nov 2024 23:59:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9dZj-0006NB-It for qemu-devel@nongnu.org; Fri, 08 Nov 2024 23:59:55 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t9dZh-0000fL-W8 for qemu-devel@nongnu.org; Fri, 08 Nov 2024 23:59:55 -0500 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-71e4244fdc6so2489947b3a.0 for ; Fri, 08 Nov 2024 20:59:53 -0800 (PST) Received: from localhost.localdomain ([118.114.63.54]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724078a9ac8sm4718365b3a.79.2024.11.08.20.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 20:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smartx-com.20230601.gappssmtp.com; s=20230601; t=1731128392; x=1731733192; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pe8SBHoLAZphIXqOGJa/qUqOysZpgdOltfKYUVIh7vA=; b=mi4rh9b1A0EaYEidZw+/gVjtd8bCYvvBLngH1Z0ton6mUTDGKqreUqy2NFGI/NPpzd mausE8xtDvLS7I6pJe4afXS72Yz3cF4guia5CCmeolcZWOueY/mZM4MXFCvzJfVeFDa+ cyoenFbaBrtTAYcK+ST6T/ecrWgmg1ImcrKQOKfsePXhf68QQGA5e4Firh6DNGTmkWV0 h+ww4gTWXdzouJPgiJkUcad/fxcvUYWYwwB9LaUh4Gp0XHN1Mfr92wyTa23F5ODa+uIR RMN4Ax3mXQyvDWP0HY5x4nMpgNsm4/SaOh4WnkzJeT2zWibM34Mzc3DtqFqoCZkGatZS f8RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731128392; x=1731733192; 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:message-id:reply-to; bh=pe8SBHoLAZphIXqOGJa/qUqOysZpgdOltfKYUVIh7vA=; b=F6zPqeG0ypk9YHq6HzZV+ZcUZiZ2bmlm3ErRdAVj+ZHqfMINrs/GBmGFFXI6XJK6U0 q+mG3FG1lbfoD2h+vcJEZ2QRtliFk9DW/AccV9lMAABYBUzHGYv0Y51uL9suPK0EaLoB uarrOW8nIvJv4nlCFHleFvOCQxKiP25fFiOYxklkJOSGACjqEBtuFcYjxPQ60lDjec/d ssTgIFPOGPpKIFD2qlaqtwIwNpUDac5BoZpTKFZAUv2734zrVHBYET6HkS+cLoLw5+C2 13vRHKRrq69wuFPAwjjGWoreG3QcmscpSdeV7jiXUNFoV7yPqIdngDG3IpiVyd76h5rX qOCA== X-Gm-Message-State: AOJu0YwpQj6xVqloSImSRoRmv76KLBpRolOi5dgorRb+jGGZNBzXbB5o oRWi0z+hTERe1TKI/QnZhFkDP5qn2NTqPNRXgkW5ySk6ks6vg86AJIcfugFSKTPSBHk1i6OCoIw kiOhoUg== X-Google-Smtp-Source: AGHT+IH/ANoqO6TccTq1Rf0TFJt6/rfvYZpMFW6aa9hhhY1MLru+b8FZD280aWa38aayNYJz6tENzQ== X-Received: by 2002:a05:6a00:3c95:b0:71d:f15e:d023 with SMTP id d2e1a72fcca58-724132c7aeemr7007968b3a.11.1731128391786; Fri, 08 Nov 2024 20:59:51 -0800 (PST) From: Hyman Huang To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , Wei Wang , David Hildenbrand , "Michael S . Tsirkin" , yong.huang@smartx.com Subject: [PATCH v1 1/2] virtio-balloon: Enable free page hinting during PRECOPY_NOTIFY_SETUP Date: Sat, 9 Nov 2024 12:59:41 +0800 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: 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=2607:f8b0:4864:20::433; envelope-from=yong.huang@smartx.com; helo=mail-pf1-x433.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @smartx-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1731128471028116600 Content-Type: text/plain; charset="utf-8" PRECOPY_NOTIFY_AFTER_BITMAP_SYNC was interpreted by free page hinting optimization as an indication to begin freeing pages. But there's no assurance that a sync is required when beginning a migration. Therefore, during PRECOPY_NOTIFY_SETUP, as well as PRECOPY_NOTIFY_AFTER_BITMAP_SYNC, enable free page hinting. Signed-off-by: Hyman Huang --- hw/virtio/virtio-balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 609e39a821..2f1e086cd8 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -663,6 +663,7 @@ virtio_balloon_free_page_hint_notify(NotifierWithReturn= *n, void *data, case PRECOPY_NOTIFY_BEFORE_BITMAP_SYNC: virtio_balloon_free_page_stop(dev); break; + case PRECOPY_NOTIFY_SETUP: case PRECOPY_NOTIFY_AFTER_BITMAP_SYNC: if (vdev->vm_running) { virtio_balloon_free_page_start(dev); @@ -679,7 +680,6 @@ virtio_balloon_free_page_hint_notify(NotifierWithReturn= *n, void *data, */ virtio_balloon_free_page_done(dev); break; - case PRECOPY_NOTIFY_SETUP: case PRECOPY_NOTIFY_COMPLETE: break; default: --=20 2.39.1