From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 014F0A0C4C; Fri, 16 Jul 2021 13:08:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A21B34067B; Fri, 16 Jul 2021 13:08:27 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2081.outbound.protection.outlook.com [40.107.243.81]) by mails.dpdk.org (Postfix) with ESMTP id 37BF740151 for ; Fri, 16 Jul 2021 13:08:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N9AWKvO4TTu0k5eMKjFgMdrkUm59P/vVEHGpYqHxdyJYYskQbhO6dfOsNSsD+D8meY4WBIh1sOSxyt57TCxMQWM/XIZk7GRT0S9LIfeuKX2DmOOTwi6SYS4Z9n8cYd78IwGzhPr/VZ071RmZ9rnnMB0sa3O0icke90kPu/YFcEznnt3QKI4WvFPysmVjqB08JRLBrr0Gdf2SVrZaYLSA/uO0cOg3SWQ55oNlSjSWJslQBo6L+9Ccvv9LmcCZF21pXGFlSIQK5G6EgA05tLaPMOh5qVz2g9+0H0yBHsfnS7iOXwcrFQ6ii6swci7MXw/qOoNJN686ZzfyrPrPDC6J3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RAQCwwi55RpOqcP/ULNtZlkHizlktTwNrIlHyK6bPWw=; b=dDprv+euHkCmWephuHl6DWqOt7VYJQywQtwbjpIuC9bQWM5Ji2iWFb80c/uXWg930AvXJo+Th6rEfjiQAnHgppBcLd/sUtBGoTECPYhz2xUSWxtpDLa9I10R9aUdLhKfhf9uqiUA2iB7GIO1ZrRqZyeilL1neYzL6XP3cG0UhWu6Vn+vBeatUCuy8LlH0ksLC9VsNHW6hMs80lpqM5HvkQCltaM8wzz+z0qlL6jE2HlskxdSiTWjQ3sZkvhRWNYNc/Vy0cNeY7YCtYvIIq6+JzodVde013BLzfU+zHAFz6UTRS2XlUhZOaZZK/p9mx5ISKF8x/BCb7Dqg9U2xSYYjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RAQCwwi55RpOqcP/ULNtZlkHizlktTwNrIlHyK6bPWw=; b=dbtWvkFn/cqqwUYFUZcvtV2jlPaD+8GKO9ASZLL8eswdZfGIcEwq726w1D7ND24WTFX71E8fcCCM/DDXLyBHOlg098cuuzgKqryu0GnwiHWap34FYEOnbBjpLCWB3BlAMdd0C124h7Am6fqP207jPUSfk63jy96TfBKeTS4rrN51pUdJIfc0KrWg9O8Dt5EOFBBC82vmBbEH95z4OPUJ4dF3dgnVxFDPIyVUFU4biL/8Q8ZMldWI2P3D3whnSexf5j0YcBQiUoBL6Sfg/XsKH+U0DZnrhv+uMExUXgI4UfHbRQT6ZEtKTpDgPaGgpnHWPaUN4EQfleVAvweLkjtvQQ== Received: from DM3PR12CA0073.namprd12.prod.outlook.com (2603:10b6:0:57::17) by BN6PR12MB1873.namprd12.prod.outlook.com (2603:10b6:404:102::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Fri, 16 Jul 2021 11:08:24 +0000 Received: from DM6NAM11FT027.eop-nam11.prod.protection.outlook.com (2603:10b6:0:57:cafe::fe) by DM3PR12CA0073.outlook.office365.com (2603:10b6:0:57::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Fri, 16 Jul 2021 11:08:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT027.mail.protection.outlook.com (10.13.172.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4331.21 via Frontend Transport; Fri, 16 Jul 2021 11:08:24 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 16 Jul 2021 11:08:22 +0000 From: Dmitry Kozlyuk To: CC: Anatoly Burakov Date: Fri, 16 Jul 2021 14:08:03 +0300 Message-ID: <20210716110806.2566788-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210705124950.902701-1-dkozlyuk@nvidia.com> References: <20210705124950.902701-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be281bd2-3838-49e8-1490-08d9484a07b4 X-MS-TrafficTypeDiagnostic: BN6PR12MB1873: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2tOEJQsFzhWUikjlmbRED5ypxzB9Wk5XX6rW+nu7y2jXC46nMGEf6fzbuFp/g33uSJIB8Cp/JJevvstcL8JKAtVE7WPWTjl01QTAwCRROhAW0mWr3FIo5dv2ruwEWO+xJVcyFvSp4PCAxvX9dI0CkM8XKWy0TCL/Y/kFNFynwXVI70za7S3zi7Byd3hYy79HMztfMzmObCsn83aO0+Iio67N8+SRRydpm+y7zaIigga/eF0mXoANB5BdDsQ9J3akKnZt71HrLqPSkON5NFrBXUVv0eh3p82WBBUqgMF0SMaqm0oY+aKv0A9zaVMDQDqTq3tjT/vaJEOvhGvcxWDJeyWUKdlTPr6i8vRntzbavHHq7Z34PTfnP/6qSrWB16pYkclsXeBM53VAh0QCkfWNfmYYOtO5UoB/lIQ8N3lEgY97XcDFe6h6UPHMMkdoWkhq4kB0BUdoM8mwd5eETcX0t5bC5ipX/LSctlLJ8EWeAaWmEq1pRc+UqgNKVx4hfN3Cy/tzdtUB+z8EK22kI4YcLSr5eAwHEjPDcZUq/aWok5+TWIcuvn60fL56g8qlk/a5J4of9s+PyiAPfRESK4luvIt4PLGvRTkFQGwcAQZdGiNn8JINhl2MfPEr+IJhZSUyL6Ij3p/q/i8uD6UKXaKoeijUuhuz1JmnJL9eB3XAXw8jyby69TwkblIZV4wbEnIgWi5M8FwSnktUmVur6U6MBX/7jnSTOLNjD8Odi/3sZJo= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(346002)(396003)(136003)(39860400002)(376002)(46966006)(36840700001)(7696005)(478600001)(186003)(70206006)(356005)(6666004)(4326008)(36860700001)(6916009)(2906002)(26005)(36756003)(5660300002)(7636003)(82740400003)(86362001)(16526019)(8936002)(6286002)(83380400001)(2616005)(47076005)(426003)(8676002)(1076003)(70586007)(316002)(336012)(36906005)(55016002)(34020700004)(82310400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2021 11:08:24.1858 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be281bd2-3838-49e8-1490-08d9484a07b4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT027.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1873 Subject: [dpdk-dev] [PATCH 21.11 v2 0/3] eal: add memory pre-allocation from existing files X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hugepage allocation from the system takes time, resulting in slow startup or sporadic delays later. Most of the time spent in kernel is zero-filling memory for security reasons, which may be irrelevant in a controlled environment. The bottleneck is memory access speed, so for speeduup the amount of memory cleared must be reduced. We propose a new EAL option --mem-file FILE1,FILE2,... to quickly allocate dirty pages from existing files and clean it as necessary. A new malloc_perf_autotest is provided to estimate the impact. More details are explained in relevant patches. v2: fix CI failures Dmitry Kozlyuk (2): eal/linux: make hugetlbfs analysis reusable app/test: add allocator performance autotest Viacheslav Ovsiienko (1): eal: add memory pre-allocation from existing files app/test/meson.build | 2 + app/test/test_malloc_perf.c | 157 +++++++++ doc/guides/linux_gsg/linux_eal_parameters.rst | 17 + lib/eal/common/eal_common_dynmem.c | 6 + lib/eal/common/eal_common_options.c | 23 ++ lib/eal/common/eal_internal_cfg.h | 4 + lib/eal/common/eal_memalloc.h | 8 +- lib/eal/common/eal_options.h | 2 + lib/eal/common/malloc_elem.c | 5 + lib/eal/common/malloc_heap.h | 8 + lib/eal/common/rte_malloc.c | 16 +- lib/eal/include/rte_memory.h | 4 +- lib/eal/linux/eal.c | 28 ++ lib/eal/linux/eal_hugepage_info.c | 158 ++++++--- lib/eal/linux/eal_hugepage_info.h | 39 +++ lib/eal/linux/eal_memalloc.c | 328 +++++++++++++++++- 16 files changed, 735 insertions(+), 70 deletions(-) create mode 100644 app/test/test_malloc_perf.c create mode 100644 lib/eal/linux/eal_hugepage_info.h -- 2.25.1