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 B5FB9A0548; Mon, 20 Sep 2021 14:53:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3553C40DF7; Mon, 20 Sep 2021 14:53:21 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id 4B9C840DF5 for ; Mon, 20 Sep 2021 14:53:20 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) 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, 20 Sep 2021 05:53:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CttL5gv7RQ6XwbMiRdUpBKebSr6USY1J9bNsY7X+iggo/qD6zDolgy/y8Wy9iJ1DGea8/y4tYjVnXfcQ6hQb3u4yhXHphrsZx9hNbNljjIxbh+Ab91l7+K4Suj8rCQhjc4/8441VpxEZM0dn1YlGRTIpJ/fTndMvSzBLQTJ+Ir/l5Fix84gTdhxQtQUY7GXVXuAemE0W7TEBAuPjPu1ols/SuOWPrijNUxR4aawkIjSENrTpuf/UUPmDQj4vDYLiomdmPVxaolNEiN7mrZdV6UiYaaSIx9hr759365muy+bkSBanoCab4BAKmL0K9KO0UJBvVzwtqkKiGptuIRX7cw== 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; bh=pRhjBlm0llFriNxJi9aQLbucWJPQeVJKc7MmWWd0cJI=; b=KngBFxJPq0qp1Isqq2/2mJiCRk+o3gUh7TNlGT34+0R3psXHSDYjXLD5mksfB3v48L4tLSZhdZtGfHjVvnXmk3g4uHxDIXp5GoyhXLDRoP/kDVO6NzvvlF7GQ9+IywmztTeuUSXAqUhU/cUSw6ffX5ipeHX/Wqo3jlbTn/cjv2G0ld1KSzt7XmbRU/bDy9IEOfaVpVpQAy0QOBKOgmjxD12lhmXuSOd3jPEz8LA1ImG5zqlMnjcnGzqls413/NMCXICOMYFkoT42pL+CDWg2zJYAptMp7I/PIQEnVkuz34+7HqlCSmRjjZ2rUXBQU0vJ9JMNw3E8///RlKyRXrjqgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) 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=pRhjBlm0llFriNxJi9aQLbucWJPQeVJKc7MmWWd0cJI=; b=JsE6Zc2Ksw1L83rsx3P/DR6H0nqh2CvmaAPmg7w6O531l/rZwruqf4JagIwiAoZPpX5YkQkHgBJb1O8OKneDwtBIDpW454cSDvi5XSgBlt8sRGkaaiGSWd8mXilvYPmxy9p9L6yFPKmxtyWWRR77FtPOZBwgreCL1XLKv7aGCV5PAlAXYmaGfZxb4+9rcSX09AGDw2DqLnP0la5rhS9YMg0ut1UQWRBrBtbORWDwGhsXu7g1hI0boXKXNp6YnYFAAFqluWHLmbxGXpKgQChRdS0ek8Ehk0kVavBv7aIzrPxM3rt3TWgaZBq67UulaiFdc/UA5Dic3WEayCmQIU4vqw== Received: from MWHPR17CA0081.namprd17.prod.outlook.com (2603:10b6:300:c2::19) by BN6PR12MB1859.namprd12.prod.outlook.com (2603:10b6:404:ff::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Mon, 20 Sep 2021 12:53:17 +0000 Received: from CO1NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:300:c2:cafe::eb) by MWHPR17CA0081.outlook.office365.com (2603:10b6:300:c2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Mon, 20 Sep 2021 12:53:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) 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.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by CO1NAM11FT033.mail.protection.outlook.com (10.13.174.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4523.14 via Frontend Transport; Mon, 20 Sep 2021 12:53:16 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 20 Sep 2021 05:53:16 -0700 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 20 Sep 2021 12:53:15 +0000 From: To: CC: Anatoly Burakov , Dmitry Kozlyuk Date: Mon, 20 Sep 2021 15:52:59 +0300 Message-ID: <20210920125302.820273-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210914103456.535427-1-dkozlyuk@nvidia.com> References: <20210914103456.535427-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: HQMAIL105.nvidia.com (172.20.187.12) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4a97a77a-a343-4c6d-7b83-08d97c359dba X-MS-TrafficTypeDiagnostic: BN6PR12MB1859: X-Microsoft-Antispam-PRVS: X-MS-Exchange-Transport-Forked: True 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: qBQLjVoq5nnBzeQY/qJPNUx+6xVY3O0oKQEVfBSgKTafpsbOcYzzCl2EKYj1j6oQ02OiQ36qMJcg1eb6CthQHk8gTdZS+EKGdmaWi7VYbxvu1T6aeNqglb5BanrRosP4B7eX2AJMcIY1o/wKoC1PJVQY08vNZZYVpR3rBjC5rJKRtyu7/KH5QR/Qsimvy+915SA1IhRoVv1JYaskHP2/a0mJOZ26KecQFxw96tVbKqnquW+cjxKqDi3U2+l2q/rS9SzdNYrptq1jlRIXy2+6B7aQrhDOKjIh44yJbp5PVeYEELLtMzciNTOg+50yu+CQwhFV2wf97cEtpVo86WnUz6m/MjkNc+mzZiz4/ad6SsS5msBgx0DAnAhP6N+ICJxz33fd+zHrOK+Up3fg2wS2BFYh5nh+MduloKqoebG6zh+h/Agq/ut4F2kFlyFOhcvcyLgFQk5K9pCvQ+N+Y76n5EZuE76QaaUnqBgQ/MPL1yNg2HuX7r7bMY6HLGRt8rzgy+S+mNc17hIdTyOkfTFZOb8afZOFmMdi5J68F90pzcsEZXiaVEXOxFrNFkBXJOK9MjYVfUhrTKRAyvFCeze0bJIqvu/wxY77EaClQ/4cvd5kGPw+rc7D3KAVV513isiy0Qj527W/m6vTHEwWL3avtn3VcsxyVQ6Eu0PA4J76JLAbC5ktKwuQpELi+OOBojjGMSoBLRRw6wPekFGDfgAaqQ== X-Forefront-Antispam-Report: CIP:216.228.112.32; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid01.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(8676002)(2616005)(8936002)(16526019)(2906002)(55016002)(36756003)(2876002)(4326008)(70586007)(7636003)(6916009)(70206006)(7696005)(54906003)(107886003)(82310400003)(1076003)(6666004)(47076005)(6286002)(508600001)(426003)(316002)(336012)(83380400001)(356005)(26005)(5660300002)(86362001)(36860700001)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2021 12:53:16.9871 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a97a77a-a343-4c6d-7b83-08d97c359dba 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.32]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1859 Subject: [dpdk-dev] [PATCH v4 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" From: Dmitry Kozlyuk 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. 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 | 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