From nobody Sun May 19 20:13:05 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556948686; cv=none; d=zoho.com; s=zohoarc; b=OuE77eU5/wI0sE0eZMbjoF4p97WeKMyqmLS1oUVlSXXaFgriY4nURXdTruvCqcpUsF+v/rTgW/FOq6ulqxwxLJpM1FMn2whUfm5HS1Uvm4Fy6tTgXiW7ZCRnIFlInECalGSH3IDj58xo66xktps7yKgiUfCMW1V8qsvLCSRH+Kk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556948686; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=LwjgHlzj47c6HBw2yUELe/nayVtelYRg/FE85pLHZZw=; b=g7pufNj/fZmzDoSrAQBT0kl92kkJcHu7UiBF1dDw6VRxXl7LWa6Wp3/KSwqGjCZO809QWx3mQq3N52U0346cUeuWbKy2FB6BUHm9tCnASBi4ArCGw9h8g8C6YbgajhApQaVWHPPh5icl2DCWHKvIl9H6wrLamEc87TGARO7NP2Y= ARC-Authentication-Results: i=1; mx.zoho.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556948686123717.5123750364206; Fri, 3 May 2019 22:44:46 -0700 (PDT) Received: from localhost ([127.0.0.1]:51504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMnTK-000590-La for importer@patchew.org; Sat, 04 May 2019 01:44:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMnSQ-0004s8-AG for qemu-devel@nongnu.org; Sat, 04 May 2019 01:43:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMnSP-0007u2-BN for qemu-devel@nongnu.org; Sat, 04 May 2019 01:43:34 -0400 Received: from mga06.intel.com ([134.134.136.31]:56092) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMnSP-0007rR-2A for qemu-devel@nongnu.org; Sat, 04 May 2019 01:43:33 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2019 22:43:26 -0700 Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by orsmga004.jf.intel.com with ESMTP; 03 May 2019 22:43:24 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,428,1549958400"; d="scan'208";a="296895795" From: Wei Yang To: qemu-devel@nongnu.org Date: Sat, 4 May 2019 13:42:55 +0800 Message-Id: <20190504054255.8610-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.31 Subject: [Qemu-devel] [PATCH] migration: don't set MIGRATION dirty range for ignored block X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quintela@redhat.com, dgilbert@redhat.com, wei.w.wang@intel.com, Wei Yang , pbonzini@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The ignored blocks are not migrated and those ranges are not used. Signed-off-by: Wei Yang --- exec.c | 4 +++- include/exec/ram_addr.h | 2 ++ migration/ram.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 86a38d3b3b..97da155c12 100644 --- a/exec.c +++ b/exec.c @@ -2192,6 +2192,8 @@ static void ram_block_add(RAMBlock *new_block, Error = **errp, bool shared) RAMBlock *last_block =3D NULL; ram_addr_t old_ram_size, new_ram_size; Error *err =3D NULL; + uint8_t dirty_memory_clients =3D ramblock_is_ignored(new_block) ? + DIRTY_CLIENTS_NOMIG : DIRTY_CLIENTS_ALL; =20 old_ram_size =3D last_ram_page(); =20 @@ -2252,7 +2254,7 @@ static void ram_block_add(RAMBlock *new_block, Error = **errp, bool shared) =20 cpu_physical_memory_set_dirty_range(new_block->offset, new_block->used_length, - DIRTY_CLIENTS_ALL); + dirty_memory_clients); =20 if (new_block->host) { qemu_ram_setup_dump(new_block->host, new_block->max_length); diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index a7c81bdb32..4765435fb8 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -72,6 +72,7 @@ static inline unsigned long int ramblock_recv_bitmap_offs= et(void *host_addr, } =20 bool ramblock_is_pmem(RAMBlock *rb); +bool ramblock_is_ignored(RAMBlock *rb); =20 long qemu_getrampagesize(void); =20 @@ -117,6 +118,7 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize= , Error **errp); =20 #define DIRTY_CLIENTS_ALL ((1 << DIRTY_MEMORY_NUM) - 1) #define DIRTY_CLIENTS_NOCODE (DIRTY_CLIENTS_ALL & ~(1 << DIRTY_MEMORY_COD= E)) +#define DIRTY_CLIENTS_NOMIG (DIRTY_CLIENTS_ALL & ~(1 << DIRTY_MEMORY_MIG= RATION)) =20 void tb_invalidate_phys_range(ram_addr_t start, ram_addr_t end); =20 diff --git a/migration/ram.c b/migration/ram.c index 1def8122e9..44525e3816 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -159,7 +159,7 @@ out: return ret; } =20 -static bool ramblock_is_ignored(RAMBlock *block) +bool ramblock_is_ignored(RAMBlock *block) { return !qemu_ram_is_migratable(block) || (migrate_ignore_shared() && qemu_ram_is_shared(block)); --=20 2.19.1