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 8DF4DA034F; Mon, 11 Oct 2021 10:57:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26155410EA; Mon, 11 Oct 2021 10:57:05 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id BFD95410E6 for ; Mon, 11 Oct 2021 10:57:03 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.43) by mxs.oss.nvidia.com (10.13.234.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.858.15; Mon, 11 Oct 2021 01:57:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T7rxvntY6NXmxtskfjrM4wEaZ1p/ri9exMSi/WwaGPDD+fFblVMyev1rQUCTNGa0am9M8oak2PasV/Y0ptmZ5CV1p0hEPaLidMZoK+G/V2sm8/F6Xesbqc5Evm4DohntB1Y4ElOnT2hqqu4f7lHEh8TRQF2/20cp6hzMWskhGBZ1CBUxBBwO+QLdmrlbNm9bMgR4cJFxaEdm0OZnvMciPkIFlzNNuCjEQEjYFFhh3VmBoUwj+Y+AudS36hmwg/ikkBPI5Zc06JQhbpjocl7cw84QDwziiLntGKR4JjbfzVjQyAjZcB8vbb6eRULgRuwPEQXrsA29HU2+GIer+PZ3lg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ooVi04YeiMn1WV0oIQoxLkZ5RX1DOmNJ3sUgAlr4H84=; b=A+IHnkKPHOekIhlRpWC1PrKVxhIRZbbXRlERY9bS/+AL/l1ql7jk4nEjeXfxayipdyC2r+fL0L6X8fGn4dmukNefmau7e1RxMIxJt0nsNlfCM0w6Clm4xYWqDZy+/HyU8lsXE4FQVtzH8b6AyQfEJgNo9MPrf5f4rW4FVgq9QdxbCXhOe7fA/T1aWBjbI3XDiC3kKKiI00LyPMcd7RYU90CJSeIZfg9Ip5p+P6c6saHQOj04VsbmtI9zhTHJFhONMQ5d8qHtIal5H7V+055PFEed/yNx7kvnSFGARxkWPhad4H2pPj1qgvJR7JFJXiSQ0CK4jM0tfkdGylBtOfk6Qg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org 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=ooVi04YeiMn1WV0oIQoxLkZ5RX1DOmNJ3sUgAlr4H84=; b=YBoNsJ+FdNdYAzSaivE6BQW0Z6kg//yyyqLQU++uTHQ2p4iiSypH+VHiXTsH7PZjqWYetQeL71doKntmLwdw/LXy5Nl4Q++0pSc98+qR6kkaAcLKgM/JV9SdrjnDMS1kBEClRiF2Mmux3RCGQW1ONNahVADBos5RRpQ5oqV7KK2ujsew3/BcheXJAtFcvI4tTm8jRFDd0tRx5BCq3+gdPa9WmXpw0X7jWEFpWR381s2eqAW3beDUI/L4YQy1VMPnDUU5UUliZjM5lK9R6ECa8OKPxl6ppQl8+KoAq7SMg3Hg793mPcb4UzwipTxD0ZZuO50C3slUz4ISpYelwhQv1g== Received: from BN8PR04CA0028.namprd04.prod.outlook.com (2603:10b6:408:70::41) by BL0PR12MB2513.namprd12.prod.outlook.com (2603:10b6:207:4a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Mon, 11 Oct 2021 08:57:01 +0000 Received: from BN8NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::88) by BN8PR04CA0028.outlook.office365.com (2603:10b6:408:70::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 08:57:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 BN8NAM11FT067.mail.protection.outlook.com (10.13.177.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 08:57:01 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 11 Oct 2021 08:56:59 +0000 From: Dmitry Kozlyuk To: Date: Mon, 11 Oct 2021 11:56:41 +0300 Message-ID: <20211011085644.2716490-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210921081632.858873-1-dkozlyuk@nvidia.com> References: <20210921081632.858873-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02253e13-2b4f-4b1a-6057-08d98c9516e5 X-MS-TrafficTypeDiagnostic: BL0PR12MB2513: 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: xLs8uog8zqjHD8Sl0WMCs01mhyjtFMx0o/Wrud6RaXLeZlctSR/aRj3h5ijCBkydrhqkLQ6tXDj4u1Bs41EzjKWzLGbpP+wqyYnJWHZuAwILBve+pC83vDtPV/UwTD6QF/ULGe69qbW/Q5goFuhPuX3N2Q3v8F4JNUvEWkifP8qj3Hauy5rdzkqOCMXAWgxkAliLtaZ3MIqHfB9l66g0cCjBIehmbi8yJXRhC6gzqf8oo16C/BGJLRlRMoSNrEVV8ZMXOGw7+f0RtYmyGK0kmC0ypIVqsIo8NOuOQjek3R3ZucqjnR9OQB08k/6GDj8ymdhMbW0oaoXGBuU8nEDBqYmpeSr/t8k5WE8+iofUzIioSGpE/6hrGn5cQvycXtJ8dxE+vwHIyuK8E99jk+T5PNTjffWcND15D7QzNF29NG5jIJAGDOOZpBrbH0VIpgBg2ekUvKGICPPiotLqnfVSSHkV2b2DmtxcYG9Fw4urkAceq341JD63T6HYDdM9yVuQyZC4jRMgT1LjQFPyLV78t0W/EoF8w/PQj9Rb3gqDzS4WP927WwsdrvkA4zGLHIGlTyUJ9/vkrxZ4tSkxyHHScniaxGU81h++UITsCBiL6Zhvr3dYtg5KgLqR3GJaRsQbKrdKB4Erbm6oSnBWQPsY3uZQU9UvB7B6fa21TA4QQ9mEvOYIwGtzydkQ7EO7stVSU/yCNplaUDlaOx/u9m07qw== 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)(46966006)(36840700001)(8676002)(7696005)(6666004)(36860700001)(83380400001)(7636003)(356005)(36756003)(16526019)(336012)(26005)(508600001)(6286002)(55016002)(186003)(8936002)(70206006)(70586007)(426003)(2616005)(86362001)(5660300002)(316002)(6916009)(1076003)(82310400003)(2906002)(47076005); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 08:57:01.0133 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02253e13-2b4f-4b1a-6057-08d98c9516e5 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: BN8NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2513 Subject: [dpdk-dev] [PATCH v6 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. v6: fix copyright line (Thomas), add SPDX header for the new test file (BTW, why didn't the CI complain in previous versions?) v5: rebase v4: getmntent() -> getmntent_r(), better error detection (John Levon) v3: fix hugepage mount point detection 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 | 161 +++++++++ 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, 739 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