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 6D298A0093; Fri, 17 Jun 2022 13:25:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 68FAE41148; Fri, 17 Jun 2022 13:25:22 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2049.outbound.protection.outlook.com [40.107.237.49]) by mails.dpdk.org (Postfix) with ESMTP id CF1CD40698 for ; Fri, 17 Jun 2022 13:25:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mU9lSQDYJHLjRm5ZYvrQ7f6CVBAM5f4PFmCgoMfYdRInHyUai09C7FUfTPf9Udi/XyTRl8bNp98vE5XLbUZqZqqT869ju5HH7dvoDOiA/YJTBEA9tw1FECknFoc897q0+og44zwPGXPSKs6eO3FWSubL/6Jcwjj9VFYvtA0kK5OUBYha2O0d0nL67VII2Rbrfa/oH7wMaFZ9apkcRQwwsPgZ4bpA1LMPQfTqArAeimAhEhP1WXBsxu20xtWpz11k7/2BiSiVWahQ0xJarm6LPp4yn9RvqbZRI6cLyKvIEQZHbkf0BVMtezC2NnZN2XDGdMrzvm2FT7CQyh/9oCirCQ== 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=KJBp5XY8ZjzT2PBeSa+FE5hSwuDoovIfC1KcVEENRtByMce6XpOvHic+thT5CVqUNSuG5TFiOHOeJsG0jSLgrtPfDmpaDk2PBChAI121vk0zFD96VEDxlIp74rniKOz7lewPdu3mJ+NMrqidGzbu6onCmWICZyREVrx4tyGnTB38UksztNMXcBwRSnBkmviCvoCVjS5uzfCWkhJzYLH5NZqLMNUe5KiMZfmeoaauYqKBvCxpZ8m9juTmF6TgGEuis84D10Pl1nb5yp3QMadzY9hjWdScykD6cUsA2xltqK5UySy5gGXnGYdxym14HgvduC68ifpdOQVVmKlPbPJMvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=dpdk.org 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=SJIT7OLlVAoU6Cqb5LU0T82oevHibnWIoM8j6ysJ4QOOa/FXkZVaf5qk/uIyrBYvp2Vbvq+AuMZ7s1rwtdOMa/BkJdo6DvZxXIcND+3iX5TaJrzADdGbn83IOXiGUduTaROkuPUhdWqJcgSXHVdN4yQRFT9U6mW6CCtW+4PhXU1gkZuQatx4zR87zp5xdv3e8PZ8pZLBmr9Iug2NZrfSj7go2qdDIqcTFu+hHdjSM7oPDak1n7YkYJu9uxH1WiLmNcumgR8+m3exI8yZvWznuiS/+4jTV4w7neHVZDJycP0/SIPXVk6r3avJzH4BQfZPsJHUuTAx9S8oWxHSeFA4uQ== Received: from BN0PR08CA0026.namprd08.prod.outlook.com (2603:10b6:408:142::28) by MN2PR12MB2909.namprd12.prod.outlook.com (2603:10b6:208:103::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.16; Fri, 17 Jun 2022 11:25:18 +0000 Received: from BN8NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:408:142:cafe::4b) by BN0PR08CA0026.outlook.office365.com (2603:10b6:408:142::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14 via Frontend Transport; Fri, 17 Jun 2022 11:25:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT047.mail.protection.outlook.com (10.13.177.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Fri, 17 Jun 2022 11:25:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 17 Jun 2022 11:25:15 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 17 Jun 2022 04:25:15 -0700 Received: from nvidia.com (10.127.8.11) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Fri, 17 Jun 2022 04:25:14 -0700 From: Dmitry Kozlyuk To: Subject: [PATCH v2 1/4] usertools: add option to select hugetlbfs directory Date: Fri, 17 Jun 2022 14:25:05 +0300 Message-ID: <20220617112508.3823291-2-dkozlyuk@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220617112508.3823291-1-dkozlyuk@nvidia.com> References: <20220607234949.2311884-1-dkozlyuk@nvidia.com> <20220617112508.3823291-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: bef2cfe9-9742-4152-a744-08da50540e98 X-MS-TrafficTypeDiagnostic: MN2PR12MB2909:EE_ 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: sGNUVHqYrKUs4rQtc6IB+S37R3+mVwmyozXblthiF7F1Nqv7XwLXlGEI9c2pVRWyOLMVEyGGZaUgfnS8FKohlAd69VQL0IOBNfaIRlcFducTFx5of0eya5niQOhlMZKbYnz/PPIHfLhytQ1T5quty+mYSGSUuLZVf3gvpeg0/9x+G09xSq+J2MJ9ABaKfh7yfJfe1L3/LyFark/J8GrKj9/AkI63x5wdyU1YDGm0QqRNwtN09pVCpJTOlh8KOh7vdSEWMfjFa99pjysGOaJwjhEA98Nh9ZNs3HrFzEAFe2V5i2CWICH4J/Hy7W8GKdyhZa2x6O1ZaeZTxGVLUD3+4HguTMRs51MGWWkXvIQOQfERfb1NWtgEcmDA/It/GAW+5KUTBckJc/jqw5uuTxs6rpoISV6cwxYenIeU/T/aH10JwXc+AeopQm0zhC2617vPWKjixpOEVHuSIUfTQb+h1P2G6GVuKDdLtadxw5IWkSMP+l1mMPnpYzt6ZS+QVtEXO5j797mSF/46hURiakX6gaZGLb1TCxGMHWCRq/SenFHNpKks1rzCMbkeiqllT9zDiMzFEBgPOBhUa36feP5HEYp4xbH4f61ViyPD9VySm6xyAtypZWT70I/SlRw8qfeMsUU4bv4VhHrMLR6L54+I2F7vYOTeZHH5aTMC+LCbYh0UzSLcXLhK80/ASsuz6JOW+EfChf1YPhPwH4SwnzaZqw== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(46966006)(40470700004)(36840700001)(47076005)(356005)(336012)(7696005)(6286002)(2906002)(36756003)(26005)(426003)(82310400005)(186003)(81166007)(83380400001)(36860700001)(1076003)(2616005)(86362001)(6916009)(40460700003)(8676002)(8936002)(70206006)(316002)(5660300002)(55016003)(498600001)(70586007)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 11:25:17.6988 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bef2cfe9-9742-4152-a744-08da50540e98 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.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB2909 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