From nobody Thu Nov 6 14:12:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1489124846811514.3603751487819; Thu, 9 Mar 2017 21:47:26 -0800 (PST) Received: from localhost ([::1]:37498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmDOe-00010L-NB for importer@patchew.org; Fri, 10 Mar 2017 00:47:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmDOC-000100-IZ for qemu-devel@nongnu.org; Fri, 10 Mar 2017 00:46:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmDOA-0002RC-02 for qemu-devel@nongnu.org; Fri, 10 Mar 2017 00:46:56 -0500 Received: from mga11.intel.com ([192.55.52.93]:48331) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cmDO9-0002Pn-O0 for qemu-devel@nongnu.org; Fri, 10 Mar 2017 00:46:53 -0500 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2017 21:46:49 -0800 Received: from yangzhon-virtual.bj.intel.com ([10.238.144.108]) by FMSMGA003.fm.intel.com with ESMTP; 09 Mar 2017 21:46:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,139,1486454400"; d="scan'208";a="833030019" From: Yang Zhong To: qemu-devel@nongnu.org Date: Fri, 10 Mar 2017 21:44:35 +0800 Message-Id: <1489153475-14888-1-git-send-email-yang.zhong@intel.com> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Subject: [Qemu-devel] [PATCH v2] memory: reduce heap Rss size around 3M 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: Yang Zhong , pbonzini@redhat.com, anthony.xu@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since cpu-memory and memory have same address space,one malloced memory is enough. This patch will skip memory malloc for memory address space,which will reduce around 3M physical memory in heap. Signed-off-by: Yang Zhong --- memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory.c b/memory.c index 284894b..6af80e7 100644 --- a/memory.c +++ b/memory.c @@ -2422,7 +2422,7 @@ AddressSpace *address_space_init_shareable(MemoryRegi= on *root, const char *name) AddressSpace *as; =20 QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) { - if (root =3D=3D as->root && as->malloced) { + if (root =3D=3D as->root) { as->ref_count++; return as; } --=20 1.9.1