From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2C6D0A00BE; Fri, 1 Nov 2019 04:56:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A2B7C1D14C; Fri, 1 Nov 2019 04:56:48 +0100 (CET) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30049.outbound.protection.outlook.com [40.107.3.49]) by dpdk.org (Postfix) with ESMTP id 1561C1C2F3 for ; Fri, 1 Nov 2019 04:56:45 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V3a8pjKAS+6W51yO+hFYWae2aj7IgFUQm1gxtUhQRDrQTlJbrQLfmY/d1IY56z6MLX0QPHED4Bp0Nxn8G0uYq7Sn4paMGX2J1fhwGL9xyuLw9TDYCOO2Xkz+BSqJF8SZjxo26MyEYxIYFltYWGQF0k6xWmD4Kp+E89zT7dhs5jiQ+RPFS0xTygo7MDhLwh7MaGv7Ktl2F5S2iliKF47VFGw7LXnOwuiaxrXYIHSQPnA0vkV1xhqZ+3Fj2/ihP44Y4FeCnAK2cuEK+j/IbWW5HPuAYA1a4n1Pk58Z9nbpRDNDcMwQIxhR227dR6mp1FRvFpCql6O5UZT0PQyyV5O0mg== 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=B64G7i2sawDq4L9H2xNfCvQLG8L78ao5j9lg9QPF1y4=; b=N/BXAh+xXuz8kXPtV9m8WyDgwtBclkBtHGa255wy0bZ254CIQ7/HPULkPzn382BhJYSwknU6DUcdKBQ1GOaZY1eYr6exurHrJiiD4m+fW+K4WR3UPNneZ5/aEBh8fnCU9cFh3wihQGxUCa5aJ+SJuGs/CFrWOp0tEYdFajTNLNUutgdWkVs/eskfh5rUzMtN8nFn7zzjMMl8wS11DuzWUhuYF+gXx9Jz3yzeEERxUQGR6kCVsxrQk0mvcrqUVT0XC3uIZCVHZOnHQPhDYX/VMZPpT1zfI8tvxg1OhkDS9d8ZtcZ6xuyPTOVpi4ir2sfTwdJNHmVTmHhEQD1tNodNYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B64G7i2sawDq4L9H2xNfCvQLG8L78ao5j9lg9QPF1y4=; b=gohho4h2WHnXCX7T6KefcKatVfqOeLlli1PQP/twgQj/T0NjfHmDW3KarKprVGrhV3tlAGGqQMD0I2/xUHY+XaY1u6WwSqPKUWhSw/sW5zoOKOVy3M61gCQcqUxuag4MP4DY6VgG2Fe8NYfvkPKPj5se77v6gqc8ku16KbpBKaU= Received: from VI1PR04MB4480.eurprd04.prod.outlook.com (20.177.53.80) by VI1PR04MB6126.eurprd04.prod.outlook.com (20.179.26.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.24; Fri, 1 Nov 2019 03:56:43 +0000 Received: from VI1PR04MB4480.eurprd04.prod.outlook.com ([fe80::7156:1e3b:cb1c:c5f9]) by VI1PR04MB4480.eurprd04.prod.outlook.com ([fe80::7156:1e3b:cb1c:c5f9%6]) with mapi id 15.20.2387.025; Fri, 1 Nov 2019 03:56:43 +0000 From: Nipun Gupta To: Olivier Matz , "dev@dpdk.org" CC: Anatoly Burakov , Andrew Rybchenko , Ferruh Yigit , "Giridharan, Ganesan" , Jerin Jacob Kollanukkaran , Kiran Kumar Kokkilagadda , Stephen Hemminger , Thomas Monjalon , Vamsi Krishna Attunuru , Hemant Agrawal Thread-Topic: [dpdk-dev] [PATCH v2 0/6] mempool: avoid objects allocations across pages Thread-Index: AQHVjy+diRfR5UWIBk+QT75b6+orGqd1sf6w Date: Fri, 1 Nov 2019 03:56:43 +0000 Message-ID: References: <20190719133845.32432-1-olivier.matz@6wind.com> <20191030143619.4007-1-olivier.matz@6wind.com> In-Reply-To: <20191030143619.4007-1-olivier.matz@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; x-originating-ip: [182.69.139.222] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 29209dc6-3f2c-4cd7-25a3-08d75e7f8278 x-ms-traffictypediagnostic: VI1PR04MB6126:|VI1PR04MB6126: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 020877E0CB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(346002)(396003)(366004)(136003)(376002)(189003)(199004)(13464003)(478600001)(44832011)(11346002)(76116006)(52536014)(6116002)(64756008)(2906002)(66946007)(476003)(5660300002)(446003)(71190400001)(71200400001)(66556008)(66476007)(86362001)(3846002)(486006)(7736002)(305945005)(66446008)(54906003)(14454004)(256004)(14444005)(6246003)(66066001)(229853002)(81156014)(6436002)(316002)(81166006)(8936002)(33656002)(102836004)(4326008)(7416002)(99286004)(26005)(186003)(7696005)(110136005)(6506007)(2501003)(76176011)(25786009)(9686003)(74316002)(53546011)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB6126; H:VI1PR04MB4480.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uYaDpDALy8hHT6/pzdBNlvr2xsbge7GrvupUGbvdFL5l04YZ4HswHIcN4N+/EireD7mQbFOkyxxYbYwxwzH8+fIF6vuVCYAvfkhsTLF3O/oEUUTgZt3bIt1xP+WZC5hCobT75yY+X8TBEdD4aCKZqIfjpH+orqDOUVc2C2ck31IqdODlFRoDL3xMTOpiialL2UgsXjJU7wAJrxhVUlvjJpK/wJIwpl8RbLfUyNsr7KqDNl/A44tpiY6k5RUmRsXvyE23KDRFhBvUTLQAQAtJSNMVa6JPRCj6mMZpY6Zdfi/PP4yoOZmzX0BVCos09NMgC5/iDuM742aqhDOLnPb5yMSiYu10lTzXvQtcvYIBD7/LTWu0knSU+tydlBhLgfM/qt2Ld+spqkoYn0T6F1AEtZiCNfPZoqqb1UMPrLeYiwEorHSxoPFgCnBUvb7qnH2i Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29209dc6-3f2c-4cd7-25a3-08d75e7f8278 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2019 03:56:43.7954 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fcJMoT3cE5gHw/UA36Sq2X5WgcvZjs8jqDELMUvwFO1qWoUUG91fwUuQ3oeCqga840I3ecRPtoCbkySGZwycHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6126 Subject: Re: [dpdk-dev] [PATCH v2 0/6] mempool: avoid objects allocations across pages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Series Acked-by: Nipun Gupta > -----Original Message----- > From: dev On Behalf Of Olivier Matz > Sent: Wednesday, October 30, 2019 8:06 PM > To: dev@dpdk.org > Cc: Anatoly Burakov ; Andrew Rybchenko > ; Ferruh Yigit ; > Giridharan, Ganesan ; Jerin Jacob Kollanukkaran > ; Kiran Kumar Kokkilagadda ; > Stephen Hemminger ; Thomas Monjalon > ; Vamsi Krishna Attunuru > Subject: [dpdk-dev] [PATCH v2 0/6] mempool: avoid objects allocations acr= oss > pages >=20 > KNI supposes that mbufs are contiguous in kernel virtual memory. This > may not be true when using the IOVA=3DVA mode. To fix this, a possibility > is to ensure that objects do not cross page boundaries in mempool. This > patchset implements this in the last patch (5/5). >=20 > The previous patches prepare the job: > - allow to populate with an unaligned virtual area (1/5). > - reduce spaced wasted in the mempool size calculation when not using > the iova-contiguous allocation (2/5). > - remove the iova-contiguous allocation when populating mempool (3/5): > a va-contiguous alloc does the job as well if we want to populate > without crossing page boundaries, so simplify the mempool populate > function. > - export a function to get the minimum page used in a mempool (4/5) >=20 > Memory consumption impact when using hugepages: > - worst case: + ~0.1% for a mbuf pool (objsize ~=3D 2368) > - best case: -50% for if pool size is just above page size >=20 > The memory consumption impact with 4K pages in IOVA=3DVA mode could > however consume up to 75% more memory for mbuf pool, because there will > be only 1 mbuf per page. Not sure how common this usecase is. >=20 > Caveat: this changes the behavior of the mempool (calc_mem_size and > populate), and there is a small risk to break things, especially with > alternate mempool drivers. >=20 > v2 >=20 > * update octeontx2 driver to keep alignment constraint (issue seen by > Vamsi) > * add a new patch to use RTE_MEMPOOL_ALIGN (Andrew) > * fix initialization of for loop in rte_mempool_populate_virt() (Andrew) > * use rte_mempool_populate_iova() if mz_flags has > RTE_MEMZONE_IOVA_CONTIG (Andrew) > * check rte_mempool_get_page_size() return value (Andrew) > * some other minor style improvements >=20 > rfc -> v1 >=20 > * remove first cleanup patch, it was pushed separately > a2b5a8722f20 ("mempool: clarify default populate function") > * add missing change in rte_mempool_op_calc_mem_size_default() > * allow unaligned addr/len in populate virt > * better split patches > * try to better explain the change > * use DPDK align macros when relevant >=20 > Olivier Matz (6): > mempool: allow unaligned addr/len in populate virt > mempool: reduce wasted space on mempool populate > mempool: remove optimistic IOVA-contiguous allocation > mempool: introduce function to get mempool page size > mempool: prevent objects from being across pages > mempool: use the specific macro for object alignment >=20 > drivers/mempool/octeontx2/Makefile | 3 + > drivers/mempool/octeontx2/meson.build | 3 + > drivers/mempool/octeontx2/otx2_mempool_ops.c | 119 +++++++++++++-- > lib/librte_mempool/rte_mempool.c | 147 ++++++++----------- > lib/librte_mempool/rte_mempool.h | 15 +- > lib/librte_mempool/rte_mempool_ops.c | 4 +- > lib/librte_mempool/rte_mempool_ops_default.c | 60 ++++++-- > lib/librte_mempool/rte_mempool_version.map | 1 + > 8 files changed, 236 insertions(+), 116 deletions(-) >=20 > -- > 2.20.1