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 326FBA0C4C; Tue, 21 Sep 2021 10:16:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A74DE40683; Tue, 21 Sep 2021 10:16:57 +0200 (CEST) Received: from AZHDRRW-EX02.NVIDIA.COM (azhdrrw-ex02.nvidia.com [20.64.145.131]) by mails.dpdk.org (Postfix) with ESMTP id 348154003C for ; Tue, 21 Sep 2021 10:16:56 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.105) 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; Tue, 21 Sep 2021 01:16:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZTXil8VhOEZlE0QzbjPisgmZew4aEVx3UfKE3HFj9k6WB5QnRaeOx2OByHPgfCuTGPZPjLJVjcSKAg9V1zIGAd/6UG6nBiV0RNbS/m6LZcYU0RJ8x4lCBixJ0aYvu6iOK6Kur6AAWjiGDDunZ34JCrnoP0PKIYuirT6d/UPQ1DSoD5xgJ8BrPKrgWRVxfdiDM1QpoRu2O/LUAw8QUCH2bA3ver36DbEFe8Gfwrf4Ao3dL6sDNN2NT2j+BpOPc1mgDYSAJJmGrAH5XfHiJAQDJtDUQR/XdvI3lp+laE1684eHLIf4DepCSRQi+6HRzuX8YXavaFDoaXozU1arIF2ovg== 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=do++8rf5nctReZdWeFErtgVmyTf2uoBtnQGkWJu2F6Q=; b=Frz/u1jNZ9SFkF91H3ohit74NdUSV4uIrAlHo/P5BNqZ9KWf11h/zj5+8rFshTcK/3BJpPLJeP9DSYeUfANIQELepD61XDlXvzsZDHgLelZlTt6iRWNEqom2yj0vTBguDgc3c0wDg3auug0aL5EuLzuGnNNrslVyHIk0gUr3aXDp7qr5exz8szIrwctfcgC/l9eg/M+gn+UZEptlSzxzctPl1GkzEBJCJWGxBifSu+nbEQWlLJ9aCwAmblgg3fJEJ3dtxkaBdCBb1SqDCOkv3p9nLFTQooco+Xjl6Yf6rwGZ5c5vr8W4McndLA64Zybj86ezs2HBUcvW/LgZKMMmRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.36) 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=do++8rf5nctReZdWeFErtgVmyTf2uoBtnQGkWJu2F6Q=; b=VxBf/t3LufKsNBOnbM8yoBMqK5H5Li+qc8bo9EUclkcOvSnYfVrHWXeJbCcgrjbaxgc63O02DyLYLqHpci8/8oWEWuxLzgoMoYNPe83bcHoT5djFcNJHAdjzkHzY+wH60T1FhkiCInFbmusXGV3zcMVp6IJqEIpSwDWySiRrFADkS/aUUmSqxFzimAW+6ElZ2sQmY4dBaC7/0EhAb17xtMldJZiKYjgkYCHRpEeQXBkKDE2jDuS4Yt9njWF87MTZ36u7Yw2FKn8TgrEjh2YtTpQssmIONrgkbrOwSPBf1aZEZQms+EWllw/YMnZV+z8CgtptMGz7l92s+X3hlHH3ig== Received: from DM6PR06CA0013.namprd06.prod.outlook.com (2603:10b6:5:120::26) by DM6PR12MB5024.namprd12.prod.outlook.com (2603:10b6:5:20a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Tue, 21 Sep 2021 08:16:54 +0000 Received: from DM6NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:5:120:cafe::31) by DM6PR06CA0013.outlook.office365.com (2603:10b6:5:120::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Tue, 21 Sep 2021 08:16:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.36) 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.36 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.36; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.36) by DM6NAM11FT032.mail.protection.outlook.com (10.13.173.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4523.14 via Frontend Transport; Tue, 21 Sep 2021 08:16:53 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 21 Sep 2021 08:16:53 +0000 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; Tue, 21 Sep 2021 08:16:52 +0000 From: To: CC: Anatoly Burakov , Dmitry Kozlyuk Date: Tue, 21 Sep 2021 11:16:29 +0300 Message-ID: <20210921081632.858873-1-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210920125302.820273-1-dkozlyuk@nvidia.com> References: <20210920125302.820273-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 DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: df0e7ae0-13f9-4d13-cc5e-08d97cd82bdb X-MS-TrafficTypeDiagnostic: DM6PR12MB5024: 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: 2iWaDuLSuAcZTM4rLadx/ZLVhQmNLT2m9CtMbJqibHKS0H2jqFs3vF+qAPWL9YQ+SDzUfCdKa6fIzYogrLePz8h2H4X9pl9kInz9zEG4QjX1Yi7L/mxwTDTuz8f2zdyMCZ1px/Lun/YdOidFsiadmBzUv/D6qumg7pogMANbf+Ev6UufL0FFeXGEZjVSVqZfOXSOYDb54tB3PSsOWqlB5ZUI3i8xP5j3yn+yJfDFghsDeWAfaJfIYPSGnv4dTLPQa4CWWbuOswRPusCIU0XTKVkcLoUUyffmLkZtnI/TGfZ1+Kx6lD9DyQ7C+FFgmCtq0LttRR9gebXV+V88bpWio1eXgV+1wiFo6HmP05wkeJqF3mD1N6wIBn4ZFXZB+rNU+WZWZSqiExXRE2J6yk502hIPp/58lO+Xf9FTq4BUJeLREW6nzIzMMUOYI7LWtO0E1pxKozNXOWsxXxxI6dtE8Mb6bPuXrESRvmSKXTjl9k9dCtnSAM77euYC1k/gm3tdgJttZkwG0aoTVR2w+53R0j+dsEdO8QJUZp7ckV90oLss+Uy8wf4iswZMBzOfWOBv1xIiEBWd96/H/u5WdhAIU/qJiKXl87ZJncu6q1ICw/3SwSa+oA1Su72zLoGoAIf8TcT9m/ddp9RqzGSbPy9jQldPKfkuXS6n9wc5zdzUC3Ep49EOCnFGlwPtnBpIQuEJU0ysCMMkHaHUgZ8K8tKYcg== X-Forefront-Antispam-Report: CIP:216.228.112.36; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid05.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(2616005)(55016002)(426003)(70206006)(36756003)(26005)(508600001)(336012)(70586007)(7636003)(107886003)(8936002)(83380400001)(6916009)(4326008)(8676002)(356005)(86362001)(6286002)(82310400003)(36906005)(5660300002)(2876002)(47076005)(1076003)(316002)(186003)(7696005)(2906002)(54906003)(36860700001)(6666004)(16526019); DIR:OUT; SFP:1101; X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2021 08:16:53.9171 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df0e7ae0-13f9-4d13-cc5e-08d97cd82bdb 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.36]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5024 Subject: [dpdk-dev] [PATCH v5 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. 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 | 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