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 03453A0548; Wed, 8 Jun 2022 01:50:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7CAE341132; Wed, 8 Jun 2022 01:50:04 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2059.outbound.protection.outlook.com [40.107.236.59]) by mails.dpdk.org (Postfix) with ESMTP id 9D4534021F for ; Wed, 8 Jun 2022 01:50:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OY8u2G/2kWR2TTfM+moNfWY9EcUgfWPIUDu3pmGfWD0aNqhBEjImdmb8qbms463DWXzEdqU4RUfXX8exd2JGkG5SD7SwcsoGKUZM4D7j7gfyCVqnTD6AbhOgSwRNjRmbTK5ekBm6xw34I0XLckTMlKa6jU2k7UdMUc9mVdUkPi1KvwssijHzOQaaNrWDke7L9eWxq3J3JVrX3s2U/SpfiN/1tJGjMIITPEnCx7xoSaUzHGNVIbiLmxcxne61dp9DxRoKX671s+RZLveWWCLGwW+gB1Z0g9bOxZAKEAoGs/iICoPJX+a3WqXOWCDHlpqKIGIVsN15OtiF5gO5d52u2A== 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=4IxijkFbpYwZI+RXV+VFoqmnoirHivSYuA4FBc641Z4=; b=F1SCsruZrO42en5y+heFg4KAn80j1rYY1BRWjM0C25fo49S7c5q2LFibLYgPTYPJxQlxZA9UsJW6IQK3wVS7uYWY3VbHYAga59jwA4nf1K2KViA2K/BmZdZv5fQqUgxkFJcy3c5aH4bzPpqTNcvnlGqsZ7+yPLcKV+EK1tvFXKzI3FcjSiBiWKR+n7C+kQs0Ti8QsixKp/YSgB936KCmFjoWQLSfDanf49CBg4yXA2SAMgHulhBewsGBtjPwsIJQK38eqoNH7eUtszZhUc4Ih9Z3925Rlvy4E2dcZE6FXJ+eTSizrLmBlhcwAKldmPmxw+L4ZXnwLsBM9kRnMogmyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=4IxijkFbpYwZI+RXV+VFoqmnoirHivSYuA4FBc641Z4=; b=o0j/qOIbz1MYjDgqYzgWFvBrSNCtyNazOd5PfwHrv5bgmd1ChPEsb5FpE4Ag+bDzbfT9Ou9LfqJzXY4Vsqw9/ieF3/FNT1iWXYOHyrg8IMwezHuIb3kqTeUVKpZ5jWbksbp0nQX4YCzEb3zUxRHHK5SWzE+FhJRgbKV2xTSIHPi/aJPad5l4X9d2CwjKRXe2IAmH8g/6TmPuaxMJc/ZMoFThS537x4FSuvwIRZVN5MbHsZvr8pcWod88nUTvHBoBo1ssGWMmAdaKYTNVMGISwYdf6L1fvcW3+IHcRamQMd4cFxyAB0Kg/Fxd0yYXEthEam+5jOApVvKLmccMiaVExw== Received: from MWHPR19CA0065.namprd19.prod.outlook.com (2603:10b6:300:94::27) by MWHPR12MB1312.namprd12.prod.outlook.com (2603:10b6:300:11::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.17; Tue, 7 Jun 2022 23:50:00 +0000 Received: from CO1NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:300:94:cafe::21) by MWHPR19CA0065.outlook.office365.com (2603:10b6:300:94::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.18 via Frontend Transport; Tue, 7 Jun 2022 23:50:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by CO1NAM11FT035.mail.protection.outlook.com (10.13.175.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5314.12 via Frontend Transport; Tue, 7 Jun 2022 23:50:00 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 7 Jun 2022 23:49:59 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 7 Jun 2022 16:49:59 -0700 Received: from nvidia.com (10.127.8.11) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Tue, 7 Jun 2022 16:49:58 -0700 From: Dmitry Kozlyuk To: CC: Thomas Monjalon Subject: [PATCH 1/4] usertools: add option to select hugetlbfs directory Date: Wed, 8 Jun 2022 02:49:46 +0300 Message-ID: <20220607234949.2311884-2-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607234949.2311884-1-dkozlyuk@nvidia.com> References: <20220607234949.2311884-1-dkozlyuk@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 80d5bee3-79df-4adc-b41d-08da48e06f46 X-MS-TrafficTypeDiagnostic: MWHPR12MB1312:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X418XLzxdilhns1m89zNAgO0jGW8XJgsZ+W9M7ECnI8dwZmy07bfhEcbMAS1oLiBW7HGnVWxbX+Cp10zIzCqDArm7NVK4D1Vd6b986esIR4pLZRW0ezpPzXBkLhClaoQPxbT3uCpgjzH8e4ILJSENZWATklhJEt3WN8czyBi6njVcl24YAZtF/7Xe056C9otozmy7HHmeQe5T50y3JIzVykPoxWrzKmPsKtMIM6wu5S0SBq/BnZ2+1+9PJnA1Hk+/w/Ht0+Tpm6jf3OJO+scCKcEno4DAGgEiMym5jZxnuO5zDx30oU6xDsL1rlOFVKL8lHxTfCUOhJyY42ZrmMjSdrm2H8hUl/x12d9j/jXZTgeZ3vYu3dy5S3gydTw5KavMNbVBlIDi77MERbqLtJapDHheHN6ULGbPGWzfIBJm0xxNZDKtJ8rsltfbVxNZ6C/C00UKPFXimiIUDUJjnYlQeg3mZNJLb7zMkuit5ULgEGMz53BjE0Kl0QDN3/W13h2+Syszc519WCbFZsNLPkBSxtSKW+d0fXwuXkITr6uglndVlEvAhD+BtRY6xXmcACXIF/IjZnqVvkh/vLncjekfTFzpAWT6WqxjW/2Hf7PlqmAYExbPAGa1lIj3mzIO3yFqs+HZJT33N1abbbgOwdkBa+Z21MThp5GLzjYdYTxj9JHzO1tPQNVUYUIQJ17eB9CTsf3Qkw7Y+9UZwAjWi36oA== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(40460700003)(83380400001)(36860700001)(82310400005)(356005)(81166007)(8936002)(8676002)(86362001)(6666004)(4326008)(5660300002)(70586007)(70206006)(6916009)(2906002)(26005)(55016003)(47076005)(36756003)(316002)(426003)(336012)(6286002)(186003)(1076003)(2616005)(7696005)(508600001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2022 23:50:00.2031 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 80d5bee3-79df-4adc-b41d-08da48e06f46 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1312 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 dpdk-hugepages.py had /dev/hugepages hardcoded as the mount point. It may be desirable to setup hugepage directory at another path, for example, when using hugepages of multiple sizes in different directories or when granting different permissions to mount points. Add --directory/-d option to the script. Signed-off-by: Dmitry Kozlyuk --- usertools/dpdk-hugepages.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py index 4fdb199744..8bab086a2f 100755 --- a/usertools/dpdk-hugepages.py +++ b/usertools/dpdk-hugepages.py @@ -228,6 +228,12 @@ def main(): '-u', action='store_true', help='unmount the system huge page directory') + parser.add_argument( + '--directory', + '-d', + metavar='DIR', + default=HUGE_MOUNT, + help='mount point') parser.add_argument( '--node', '-n', help='select numa node to reserve pages on') parser.add_argument( @@ -262,7 +268,7 @@ def main(): if args.clear: clear_pages() if args.unmount: - umount_huge(HUGE_MOUNT) + umount_huge(args.directory) if args.reserve: reserve_kb = get_memsize(args.reserve) @@ -273,7 +279,7 @@ def main(): reserve_pages( int(reserve_kb / pagesize_kb), pagesize_kb, node=args.node) if args.mount: - mount_huge(pagesize_kb, HUGE_MOUNT) + mount_huge(pagesize_kb, args.directory) if args.show: show_pages() print() -- 2.25.1