From patchwork Mon Jun 13 09:08:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vijayak@caviumnetworks.com X-Patchwork-Id: 634524 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rSqGv3SRJz9snl for ; Mon, 13 Jun 2016 20:47:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=CAVIUMNETWORKS.onmicrosoft.com header.i=@CAVIUMNETWORKS.onmicrosoft.com header.b=edV9ygkK; dkim-atps=neutral Received: from localhost ([::1]:55221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCPOn-0005Wf-EI for incoming@patchwork.ozlabs.org; Mon, 13 Jun 2016 06:47:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCPJ7-0000Tb-Bo for qemu-devel@nongnu.org; Mon, 13 Jun 2016 06:41:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCPJ6-00079h-88 for qemu-devel@nongnu.org; Mon, 13 Jun 2016 06:41:25 -0400 Received: from mail-bl2on0058.outbound.protection.outlook.com ([65.55.169.58]:60904 helo=na01-bl2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCPJ0-00077A-Dx; Mon, 13 Jun 2016 06:41:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=IcYRUej3akC2bushsK0U7hU56xKjE4dECq7i0O+VV5E=; b=edV9ygkK3F29d6lyhm0Y/3aHCt36ygsGT5SjY85rCKHJ6SVJFwzQCoUjHLzrwtSC4dp+8E0dn7nTD2Tmz+aPdm9nwEDe/Y2nvkslomFHUUz1sfYg52M+XEuwdGhTKTtOHMb/eDX7TobEgxtF+2Ka4CCINlySE879VS2CrJpkmAM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Vijaya.Kumar@cavium.com; Received: from cavium-Vostro-2520.caveonetworks.com (111.93.218.67) by BY1PR0701MB1689.namprd07.prod.outlook.com (10.162.110.27) with Microsoft SMTP Server (TLS) id 15.1.511.8; Mon, 13 Jun 2016 09:09:34 +0000 From: To: , , , Date: Mon, 13 Jun 2016 14:38:32 +0530 Message-ID: <1465808915-4887-2-git-send-email-vijayak@caviumnetworks.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1465808915-4887-1-git-send-email-vijayak@caviumnetworks.com> References: <1465808915-4887-1-git-send-email-vijayak@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MAXPR01CA0015.INDPRD01.PROD.OUTLOOK.COM (10.164.147.22) To BY1PR0701MB1689.namprd07.prod.outlook.com (10.162.110.27) X-MS-Office365-Filtering-Correlation-Id: bb017257-4412-42c3-6f1d-08d3936a716d X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1689; 2:cNX3HyaEaeqCiJ1vd/ut+F9OXjKvnADokUpoAcZX8mb81Av+VW9sYxVQIxBL48NIIMRz1quBuIKOfOFk6kcrKjzaram/hYcfqDGlOOXtdi7rdX/cZsivRsRK5XcLefV+ltFDyafIxt38dX6wJbWajnodH26MUY8+AeByI9T9Xxc7b7GR936kHC5sLjHlU7fL; 3:1EcsgLVRiEuZTbSRxiRMoi0yott0B8DBGlN9Z0n2CvwvUtF55gtD2wnM6sew6juT+ZLV6nWmN5o7SsWxKpm+vXpJDx+pqLenX1uZ3P9Vir7Hy/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n4c+f9mkzNWgTxWDfr3I0PyEXaSQ9UaViIf3S/T2RunT/gS9gp5Sbv/PGr9ou863Z9UiGCe8MoBK0CsO0trHVh7c2BupDB9N+CaI20iJqIXdDm5ZECvRMjAq2saYI8tPB+SN5zrNrpmnAF9GB+WcS+nP03IN5fpylkVIH3uq8pTefZUHbHPdc96MY9GdgKqCcnbZRgrUwqOpc3iY2HFcZatqGgG92puCwR80NjhF6AyyvKqOMtGCSWnGXTkvCC1GpnOSq0Hlc1LIAhwU/lpPaHa+Zty3JTSSUwZs8/qa4AZMdDiOQsiEHwFnwcusaDPiF1E/Z6JQNCp25rS33015qCw++ygNLwvi/wBrvINrJ/KoopN8axNLIo/T0HPCJga3fmmoHORJUbT2RhwyPi5ph0BxMmV6ODWjVDj/HfcsO+/lDMqEEDX7omj45VGXlatpyX+hHdK2w+OQpJyhR4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:BY1PR0701MB1689; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1689; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1689; 4:aJOKnvGLKeNKXe9nYwrMriycZKMBrW6N9pwmdQ7a6Q9xBBbe7V3EdyQXQ+BHZPTJudbTJ1IobOoFaM7bS+n2b8mfsSgYCphAuyNba8aFOJNgEhnhvdyfPjhfeghA//bE+UfrJ9ou1O50uxy2x9AIVWRS1AmVL1HF48TKqk8c1ltyGYr980w0hc0mCDaDpdLRoIXvhbFnTt3WBkbvKe3hNJ5cZMnq9HxGLfc4HfPsG6xgidvCe7m+r5H4sXqQzTFtBdYZJUGZUwKo3oCOt5MHZvzFy7y6ffMur+xsioKLfwPP6wu0boM6bWNfDlJRgXl6mhoLb949WnYlIospUZW1J8dRQdxx7cBVLX1I/xlqU36gFzbZKIXxSqS1Wnqz80Z9 X-Forefront-PRVS: 0972DEC1D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(47776003)(66066001)(5008740100001)(33646002)(8676002)(4326007)(48376002)(81166006)(50466002)(106356001)(107886002)(81156014)(105586002)(5003940100001)(229853001)(5001770100001)(97736004)(189998001)(2950100001)(2906002)(101416001)(36756003)(5004730100002)(50986999)(50226002)(42186005)(68736007)(2876002)(53416004)(586003)(86152002)(6116002)(3846002)(69596002)(77096005)(5009440100003)(4001430100002)(19580405001)(2201001)(76176999)(19580395003)(92566002)(7099028)(2101003)(217873001)(4720700001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1689; H:cavium-Vostro-2520.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1689; 23:GSH5hxHWF/zBxSVCEURkqCXKIB554xTkUOAyP/Q?= =?us-ascii?Q?kwI4MqTL+a5Fb/7ZprzDox5tDCpXMaU7Y152iaJtjWlDwJmvG3Ll29GSweWp?= =?us-ascii?Q?6+kteD+zhnr9JBsdzCyzj42QmrIxwOxFyAu+O47VoFLdUDPTkacxl9ps1bag?= =?us-ascii?Q?4plbvGspNf8i1oC6zT/e8jFkU4RBIImbyqzYsX1BdUn6zC6kKCWcoEDR30ar?= =?us-ascii?Q?CB8DN13IQD6EW/Pr7ImWyqvKzuodSY2ye8SxvvUUX+epd/Xe6VxZ2uynz7uv?= =?us-ascii?Q?AxJAOlZwtwk7Yzhl1jH39ncMYFNCGxIpsKomleXvyy4B4u84bWRqdn798RQD?= =?us-ascii?Q?HOtBxbpYAkmaHSJEAuocsxVvV5sVdVqpseXiJV+TXCQNO6mKRJb5Ke7c8dYk?= =?us-ascii?Q?d9dXDAEN19KXGJuHKQYpdWobFX8ZfitXheGmpnPHfIJI95srdm0/IwWixskx?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= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1689; 5:XIcY7LlZOD/4UMRb/XW4CuuFMZXQNggbvFhtZRLMF2hFkMxKuFv6V3zy+qUZl95s7A21PHigcRTs0J/xhCvWUQWDl6kIM9cEPQQaZNNhyVsjfgA0nwtPnlurDGw437N5zJQBNx3VtFX0qNIegC/gVg==; 24:6oaBS4dXoIjbeSHtfnzVXRgfZIuZ+/2fKVkt+jgIDOOuEbmT5Me2j/6ExcaDBDPiUvStOBDM1IJnOZU6l+5DpJiwWZtMV+odukPzjvLAcqw=; 7:keKEMbLQu5fQESgL/cU1FG2Hs7+Uof8rCvBOTp84MhnIbrTo94vfvjnLYfp1/aK9gKPW/ocAvBq+4mhTbPaud3jjJq8MFgEKkrXlpyg1wEYG5kmhyZWiEPgi+MIUiDZdPLqDt+efsbyrqGuDsBXXIcfHi6BrrSUHivfKdz+XbaxXljidmYFZttSUHNFkrUzyJAhEtkc4XcvN4MGIITGEPqo2Yby1GmqoEK5jGZRLy08= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2016 09:09:34.4221 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1689 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 65.55.169.58 Subject: [Qemu-devel] [RFC PATCH v1 1/4] migration: Remove static allocation of xzblre cache buffer 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: Prasun.Kapoor@caviumnetworks.com, Vijaya Kumar K , Vijaya Kumar K , qemu-devel@nongnu.org, vijay.kilari@gmail.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Vijaya Kumar K Allocate xzblre zero page cache buffer dynamically. Remove dependency on TARGET_PAGE_SIZE to make run-time page size detection for arm platforms. Signed-off-by: Vijaya Kumar K --- migration/ram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 844ea46..ba3b352 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -69,7 +69,7 @@ static uint64_t bitmap_sync_count; /* 0x80 is reserved in migration.h start with 0x100 next */ #define RAM_SAVE_FLAG_COMPRESS_PAGE 0x100 -static const uint8_t ZERO_TARGET_PAGE[TARGET_PAGE_SIZE]; +static uint8_t *ZERO_TARGET_PAGE; static inline bool is_zero_range(uint8_t *p, uint64_t size) { @@ -1437,6 +1437,7 @@ static void ram_migration_cleanup(void *opaque) cache_fini(XBZRLE.cache); g_free(XBZRLE.encoded_buf); g_free(XBZRLE.current_buf); + g_free(ZERO_TARGET_PAGE); XBZRLE.cache = NULL; XBZRLE.encoded_buf = NULL; XBZRLE.current_buf = NULL; @@ -1893,6 +1894,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) if (migrate_use_xbzrle()) { XBZRLE_cache_lock(); + ZERO_TARGET_PAGE = g_malloc0(TARGET_PAGE_SIZE); XBZRLE.cache = cache_init(migrate_xbzrle_cache_size() / TARGET_PAGE_SIZE, TARGET_PAGE_SIZE);