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 B9165A0C49; Wed, 7 Jul 2021 23:58:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3341413DB; Wed, 7 Jul 2021 23:58:18 +0200 (CEST) Received: from mx0b-002c1b01.pphosted.com (mx0b-002c1b01.pphosted.com [148.163.155.12]) by mails.dpdk.org (Postfix) with ESMTP id 81227413B6 for ; Wed, 7 Jul 2021 23:58:17 +0200 (CEST) Received: from pps.filterd (m0127843.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 167LrpKD005785; Wed, 7 Jul 2021 14:58:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=proofpoint20171006; bh=VDm6EUGyKXEJmgHC4ZliXCpd+UTcD53K+gK2IahRBsM=; b=WJW80Wzcu4BwK0jEqlDZZswjtyPbyCdsxdWRBSFhovxfCviOgkt+NniDE8MDVkjxH1bd 3OZB7tipeHXJuEgGP/f3alAVBQcVC+WAXGhPMzEYEYA4Xjsc5KD2+O7bDBApUVl4MFEj c2/F4KS/ruTUvseYW5ze6psIsf4lPMbkDgLHJZjo/yXJMtXKdMdnhmI1sftD42HuCte1 Tk1KTBZW5/ssL8izPc3kP6lXEIODE9TtOM+CrlBzfeYSuYuenfqFPZwqbAsZ9MthyOmO Gy8nfkHDUzswRyZEqAQ3YhOVix3I9Qa91qVQwdtM7ud4+VljqumKg8oSxyHD0EO0CQn3 fQ== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam08lp2170.outbound.protection.outlook.com [104.47.73.170]) by mx0b-002c1b01.pphosted.com with ESMTP id 39n9n69cvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Jul 2021 14:58:16 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NGxpFOyKMlv3Y2nz0NYvl/HB+oKI2VMWFO69qxkEtH4+51IKG9L4hWTSumL7VSBArmf7hKv99jvA+74UD+gdtgGJeR7JR1tLuMTzgXqp2PCcEJoWU5NLu8HyauSXfVeF5PqPsTCCAMH5OtZPo+yPQ2DpQvXL0bjhBqZeRBFMDRngTstbzWsnBAsyxoHam3PvuIqO082scP8bKOMEYaguiofetAcqyCFELV7b2W9MC3HouKLGlZXjv4kbbaFH4Yl+wM+7EAB70BDOZ5C6BfjQTm8+Yieofsq9fHkeUqXsbU231qe5n/PtKt6Yvly1iDeWLoK4XZHjxPyAZezjaJJ8YA== 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-SenderADCheck; bh=VDm6EUGyKXEJmgHC4ZliXCpd+UTcD53K+gK2IahRBsM=; b=aDt8YftwV4IVqhodV10XOBuwuzUuIyJM0v3Xewg34QY3syofWK/cE4GRnQSWAPH25Lg5E1AJMtup3DycedatXUTWtN1O6srC+E9A1nxSoPvpYwWgYtD4g2OVkOWquXaxFi+PxZtZDhAdNOnU4Hr76syrWj8mYxcBbCoD+39tWY4j0YoSBTAOvXUvInVsZ0U8y2vp1+PqHQGcmEBbYy+5/9BVIdj2ZEUu55cQ3+znl8X+jL3s20hfht/Sb76sSSDl6oG2XstswmiHBBnWZXfVJhuijDshds1Xcr8Ljb97IvxwNmaCiYuoxReFxw9Vaccy2OJSpJ5CKBVZUUX/mVLCZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none Received: from BL0PR02MB4580.namprd02.prod.outlook.com (2603:10b6:208:40::27) by MN2PR02MB6414.namprd02.prod.outlook.com (2603:10b6:208:1b5::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20; Wed, 7 Jul 2021 21:58:14 +0000 Received: from BL0PR02MB4580.namprd02.prod.outlook.com ([fe80::6903:7fea:be33:66cc]) by BL0PR02MB4580.namprd02.prod.outlook.com ([fe80::6903:7fea:be33:66cc%3]) with mapi id 15.20.4287.033; Wed, 7 Jul 2021 21:58:14 +0000 From: John Levon To: Dmitry Kozlyuk CC: "anatoly.burakov@intel.com" , "dev@dpdk.org" , "levon@movementarian.org" Thread-Topic: [dpdk-dev] [PATCH RESEND] eal: allow hugetlbfs sub-directories Thread-Index: AQHXaa9g7Tc4VRjDokG0wklqIgst+Ks4A6mAgAAfVgA= Date: Wed, 7 Jul 2021 21:58:14 +0000 Message-ID: <20210707215814.GC400666@movementarian.org> References: <20210610210521.830303-1-john.levon@nutanix.com> <20210625104449.2096166-1-john.levon@nutanix.com> <20210707230605.58a79a47@sovereign> In-Reply-To: <20210707230605.58a79a47@sovereign> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=nutanix.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 399f2964-c659-4aa0-d341-08d94192520f x-ms-traffictypediagnostic: MN2PR02MB6414: x-microsoft-antispam-prvs: x-proofpoint-crosstenant: true x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VEkPUne+bfLzyntiJ+U97xJNggEuEmDEiZgRhJ1sSYVDacGhZyuEsEO3hrCISAoz+mhgz7IrqZEVYv9lj2gZbJ6eDvYm1tF8QXktwZ21gFpSGrU8V6v3Xzm8NLgevt+bYt3SavpWN4O0RizXZd0whYQv8ycT8IUyvV8evJC9Gxu0tphL9oG5w8yfACHizDGmk/YN7v9R0hQ+XtbP+tr/Y3+8OBjMkw3cEEFEKp5V4IUXN0K4fLfN97MqxduMo8ZRs33N0B7M7EXrFJMcCVPoZhlwOq7fNMvco7znZcc5x5C5lxzyXasVPbJMoa8kIM6KIfjIb2caKPtlhzKeFlyxkEwZhS3eAow2P3GO3xc/8jANirGNAzZ3NUiIEwfZ/L4mksg6qbed1J9lcAuygor/gDxdPmsrdwXk/N55Jx0a757+7S4RBn/PYD1U2hJcO1stOW5s9rhuwlE/IsLyShYUAIM+plX6sij3xpw8TORlB6NG6kS0P1Xl/3224GkKAbhm7SaAi7FvjeN42AbNEZvwY0/Mcer9EdR3de+YcZ9Dzkm4RdlY/l0F3XsDF0g/RQnK8GiT9daE82Fg2SKwdO0H5OSBXAc5An93lSosLWSCuXxQbR5ZC+xo4nTUwhuoqf8+/U9BAdD8G9kFf96dQwCm6YwJ/+BCzJtv/GKEYRkFsh4LneY6hDBkLJPrPesmRrmwjZBwc40XVQkhNwc6XlKNrQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR02MB4580.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(136003)(346002)(376002)(366004)(396003)(39860400002)(66946007)(38100700002)(71200400001)(8676002)(6512007)(86362001)(44832011)(9686003)(66476007)(316002)(83380400001)(66446008)(122000001)(76116006)(186003)(91956017)(33656002)(54906003)(66556008)(6916009)(64756008)(478600001)(26005)(5660300002)(4326008)(36756003)(2906002)(6486002)(1076003)(8936002)(6506007)(27376004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?x7DVMur/Uha2E/VhTWMzihYaeZ0MZz50GyNyuQRF5oOd3O507WBaalJcfUKx?= =?us-ascii?Q?z2ZVGOI374e+XqVnG6bzS2yFKzfgB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4w1CVEMGdNZyZo6W62OguK6nV7MR1e8uXfLfSQBvW5r3WOHPJpC/4nWyIC?= =?us-ascii?Q?oNmXxaAGlHEbZl5Q7eA+xdvQN8N0MPZGHbpgVwHCgATmrXYhuuwnUpZcag7D?= =?us-ascii?Q?hZP4H7Z8i8tGv9wkKO7v6JkNjdfEVSwqlIOmL9RcwFupAKnzCe04+IkfV2tT?= =?us-ascii?Q?8I1Zo8kfdc8z/2pSgASiNcVKEH/Vw8ekZKVhi8JfJ5x8VF0CN1H2zF6tb/iE?= =?us-ascii?Q?U6rsoRi/K8XlVltGKa271xxJU6Y7e8lG/xCEDmll/r1KOGbPx2+C3AjxBs/0?= =?us-ascii?Q?cYaGTNV0AkHsRJCShxbLIfnRxgkiPEpjzO0Tytx+LaiiDFCPFDKS7hclb6Nk?= =?us-ascii?Q?CcqAypC/G3ghRkL2WYGcFmb+?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: <4243B4E252C91544B06C85A90B665985@namprd02.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL0PR02MB4580.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 399f2964-c659-4aa0-d341-08d94192520f X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jul 2021 21:58:14.6206 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: nKT2+uf/8eQA+wFFfGFtiTBu3Idk3ezugOcvI+UPEMmLZel4TOElnQb7mCbvRKfiOZ0cAHVt9OFNaWygPif2LQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6414 X-Proofpoint-ORIG-GUID: XeCLQP1sOjRLxUYoVuzyTAEOg9_ug6WA X-Proofpoint-GUID: XeCLQP1sOjRLxUYoVuzyTAEOg9_ug6WA X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-07_10:2021-07-06, 2021-07-07 signatures=0 X-Proofpoint-Spam-Reason: safe Subject: Re: [dpdk-dev] [PATCH RESEND] eal: allow hugetlbfs sub-directories 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" On Wed, Jul 07, 2021 at 11:06:05PM +0300, Dmitry Kozlyuk wrote: > > get_hugepage_dir() was implemented in such a way that a --huge-dir opti= on > > had to exactly match the mountpoint, but there's no reason for this > > restriction. Fix the implementation to allow a sub-directory within a > > suitable hugetlbfs mountpoint to be specified. > >=20 > > Signed-off-by: John Levon > > --- > > lib/eal/linux/eal_hugepage_info.c | 25 +++++++++++++++++++------ > > 1 file changed, 19 insertions(+), 6 deletions(-) > >=20 > > diff --git a/lib/eal/linux/eal_hugepage_info.c b/lib/eal/linux/eal_huge= page_info.c > > index d97792cad..d7e9918f8 100644 > > --- a/lib/eal/linux/eal_hugepage_info.c > > +++ b/lib/eal/linux/eal_hugepage_info.c > > @@ -226,16 +226,29 @@ get_hugepage_dir(uint64_t hugepage_sz, char *huge= dir, int len) > > default_size =3D get_default_hp_size(); > > =20 > > while (fgets(buf, sizeof(buf), fd)){ > > + const char *dir; > > + > > if (rte_strsplit(buf, sizeof(buf), splitstr, _FIELDNAME_MAX, > > split_tok) !=3D _FIELDNAME_MAX) { > > RTE_LOG(ERR, EAL, "Error parsing %s\n", proc_mounts); > > break; /* return NULL */ > > } > > =20 > > - /* we have a specified --huge-dir option, only examine that dir */ > > - if (internal_conf->hugepage_dir !=3D NULL && > > - strcmp(splitstr[MOUNTPT], internal_conf->hugepage_dir) !=3D 0) > > - continue; > > + dir =3D splitstr[MOUNTPT]; > > + > > + /* > > + * If a --huge-dir option has been specified, only examine > > + * mounts that contain that directory, and make sure to return > > + * the directory, not the mount. > > + */ > > + if (internal_conf->hugepage_dir !=3D NULL) { > > + if (strncmp(internal_conf->hugepage_dir, > > + splitstr[MOUNTPT], > > + strlen(splitstr[MOUNTPT])) !=3D 0) > > + continue; > > + > > + dir =3D internal_conf->hugepage_dir; > > + } >=20 > Suppose there are /mnt/huge and /mnt/huge-2M mounted with -o pagesize=3D2= M. > If --huge-dir=3D/mnt/huge-2M is specified, this code will select /mnt/hug= e. Yeah, good spot. I'll change it to prefer closer matches or something. > The code would be shorter with `splitstr[MOUNTPT]` -> `dir`. Sure. regards john=