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 27727A00C5 for ; Wed, 20 Jul 2022 10:24:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0116C40A7A; Wed, 20 Jul 2022 10:24:00 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2052.outbound.protection.outlook.com [40.107.244.52]) by mails.dpdk.org (Postfix) with ESMTP id 671FE40A7A for ; Wed, 20 Jul 2022 10:23:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5MKs0MqxcjRNB5sK+/N3YsllQBgCk5S/s9f85pOvdUWiiAgT1/E9b3JHXE+QWLPN8YqnM2+2zdIx4PDvj/auzCojx0myMPERmf6bhLqARl40YpjZqYeH3QzJb5jDbDm47PWjAAF7KX36XHxLZWa0k3XfPUIwkPuxnazBKnTVHtmGXAvfrUp7vNLTDXj/81kxnKzpXbfx2uBDSYxzMkMNfJtsvfX0MrbKEdDcUtdGLg+GNF6V46zLQ+MND5kWNpKKO2QHJnx81fh6zkH3mwy+wKjVK3+Cwx0X65Rbc7/q/Gop6hQtilgUmC9oCyYrHMohZPk12Pg81Af5xtuzWtnKw== 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=6n1De5siE88WWz/K8tlZoHUZFNpw9iXMR75+C859Qn0=; b=KTJoyIPtW7md8mY8eSLLfXoE83A1goRaJl0mQSe8gzw+sTskmHJHQBzV4WCUVEPs6SRSdrOwDc95F6CreWXRHklQ7aBMNfkHwrzggme9Xim1ItQ5guWbVc3ch0Y5mMAlEoIYvNcNkdBkQ7CA+BeAF1fpSY8P1UECx196a7ew4ZVrfwKLZ5Xq3IdNU8jQYaUSQFN93DpFF6yEaRrLttX585/fYn25HUPdmNfRBHhhoFSKez4OZUmn/IuDpm73l3bqSX7Sy6R8NdgE8LXCE77UyDwctHVhRd2vaOTSLBaKRstEQX4PTgjJJ4kid7IGs7m3e0W9yNxVB1ZV9g+w5CaqsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) 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=6n1De5siE88WWz/K8tlZoHUZFNpw9iXMR75+C859Qn0=; b=Qf2/Rm1ZF0ADTOVX51CJYygKh51JikFucyRgIfbo1nm3iMAF4jUqolKFQeQzgkW8kdIyWPCuat7enZHolKw48EJlqmz0ZiP5Y3CqoxmAwZ5cBHcx55KmDswYGdxL/38LV/ZuzOwn3elY//fhEI89D7qq5jGsUsy/UesVTUT5NniXXVOT3UcZoKJcMAymSZUqfvuCDbl2btgB1AHUjeuc9gIZbcvinFpS6TMJ+QgaDMAjvCxjbzNkY2Ia0sw2MYRmRNESA8+3FM+jIOwUOUsburgnCVPcxBBvAkdfeAlyCSAAH024MBAKMH21e1DCr2pBF3THtVodGSrRKNPCaRVYWg== Received: from MW4P220CA0005.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::10) by DM5PR12MB1450.namprd12.prod.outlook.com (2603:10b6:4:3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.21; Wed, 20 Jul 2022 08:23:56 +0000 Received: from CO1NAM11FT030.eop-nam11.prod.protection.outlook.com (2603:10b6:303:115:cafe::ba) by MW4P220CA0005.outlook.office365.com (2603:10b6:303:115::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.24 via Frontend Transport; Wed, 20 Jul 2022 08:23:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by CO1NAM11FT030.mail.protection.outlook.com (10.13.174.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5458.17 via Frontend Transport; Wed, 20 Jul 2022 08:23:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 20 Jul 2022 08:23:56 +0000 Received: from nvidia.com (10.126.231.35) 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.26; Wed, 20 Jul 2022 01:23:54 -0700 From: Xueming Li To: Fidaullah Noonari CC: , Dmitry Kozlyuk , "dpdk stable" Subject: patch 'malloc: fix allocation of almost hugepage size' has been queued to stable release 20.11.6 Date: Wed, 20 Jul 2022 11:20:54 +0300 Message-ID: <20220720082132.3954126-25-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220720082132.3954126-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> <20220720082132.3954126-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d9f8a1b2-751d-4579-5ab5-08da6a293066 X-MS-TrafficTypeDiagnostic: DM5PR12MB1450:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?/Rt6uoY6ZQhVK6pX195XL8nrctpmAZcL0YF7Kwlkq8C1urd+KsyecOqfQH3k?= =?us-ascii?Q?KRD1PieyiUYrVO/Zn/RvO1Khe5b9t7UYVWtfSYRXHo7Gx8ikn4eJoiZ7Juvv?= =?us-ascii?Q?1o0DOe4/iQmsCY1wBFmyj61pWHVzyxf0cttNbPtQ4lvZ/7vRREG3NG9Q7CVh?= =?us-ascii?Q?TASLCMuENngHe5k4pSf9hJxzne08XPWpi27XdK+6jbICshxMEtlxPG6ErgF2?= =?us-ascii?Q?7lM/UAGQeFRqPshFxwmH6hDNADLsRqYoUGv+xxGJkv9ANDhAaEbz7cQo4/G1?= =?us-ascii?Q?eriSOk+PK+9QHfvh0lRDPGKmSccCr+qA4ZYHbbAuVgh6rLolEbzgM/1LmfY4?= =?us-ascii?Q?AyT1w8BSXzv3wHW/qgd6ECzTQjQwBqE9u/MIG6nXlt49m47pLJZzCTgRESxG?= =?us-ascii?Q?Nm5Uo4Kq1PxAohhSLRuueTuzxcZ3NrVWXjr13hoXiUTlg7UpsnDNidgpYVOL?= =?us-ascii?Q?gFzoWmVVwVJnjm6ltLmxzwpLuPjCfRWq4cZZhU8lIztSarOC2xk/UlRrBpNm?= =?us-ascii?Q?IrG6wtJ9IGGmDa8LH8+vxKgaDl1aE9gFIEa7UmLlu0Kxy1BD70ybVFAf8dcx?= =?us-ascii?Q?vbCSUNxb0vdlMQQ6AqoOm8KFfHIxA9sHtX7fvklabd0xLFJECcDgpOJ3C14K?= =?us-ascii?Q?wwpNjnREvSJEUwtWdj074MG9mMHbL8OkKrwoW/43AGKj7+fWBsM7FMlTJ5QS?= =?us-ascii?Q?NOkgYT1sl7U7Z+0ucTc59wsfBk9m7kEqADFImLm6JCcdupcryrn5VOMkWCXN?= =?us-ascii?Q?b8j1FzVZUxSatRSoepSZNcjcjM/26N+92ngAoqDyVROYWmn+ME6xLTVXpiEt?= =?us-ascii?Q?zOecxArha4hrTO/13PwYLlo7rEYIBL2wmCnYw/Um+LZ3nsN7ukzDCW+5FM+z?= =?us-ascii?Q?qTZqzjvR8Ai3xjr9/pIn3ZBKm6STG5/QPtYnBonZd8A6d5Fa/JUVzn07HPvD?= =?us-ascii?Q?oabBWcFfIgl8esgYMQwltg=3D=3D?= X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(376002)(136003)(346002)(396003)(39860400002)(36840700001)(46966006)(40470700004)(36860700001)(4326008)(40480700001)(8936002)(316002)(5660300002)(6916009)(55016003)(82310400005)(54906003)(40460700003)(2906002)(70586007)(83380400001)(16526019)(8676002)(70206006)(36756003)(356005)(86362001)(82740400003)(41300700001)(81166007)(966005)(336012)(7696005)(6286002)(2616005)(186003)(47076005)(26005)(478600001)(1076003)(53546011)(426003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 08:23:56.3157 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d9f8a1b2-751d-4579-5ab5-08da6a293066 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.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT030.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1450 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/22/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/dbbdee4c12fca634bf094e703465cb59eba8ca51 Thanks. Xueming Li --- >From dbbdee4c12fca634bf094e703465cb59eba8ca51 Mon Sep 17 00:00:00 2001 From: Fidaullah Noonari Date: Wed, 25 May 2022 10:18:37 +0500 Subject: [PATCH] malloc: fix allocation of almost hugepage size Cc: Xueming Li [ upstream commit ce2f7d472e80c1b6779f230a1c7b137157f5ff3d ] If called to allocate memory of size is between multiple of hugepage size minus malloc_header_len and hugepage size, rte_malloc fails. This fix replaces malloc_elem_trailer_len with malloc_elem_overhead in try_expand_heap() to include malloc_elem_header_len when calculating n_seg. Bugzilla ID: 800 Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug") Signed-off-by: Fidaullah Noonari Acked-by: Dmitry Kozlyuk --- lib/librte_eal/common/malloc_heap.c | 2 +- lib/librte_eal/common/malloc_mp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c index 350ff97ee0..f4e20eab92 100644 --- a/lib/librte_eal/common/malloc_heap.c +++ b/lib/librte_eal/common/malloc_heap.c @@ -397,7 +397,7 @@ try_expand_heap_primary(struct malloc_heap *heap, uint64_t pg_sz, bool callback_triggered = false; alloc_sz = RTE_ALIGN_CEIL(align + elt_size + - MALLOC_ELEM_TRAILER_LEN, pg_sz); + MALLOC_ELEM_OVERHEAD, pg_sz); n_segs = alloc_sz / pg_sz; /* we can't know in advance how many pages we'll need, so we malloc */ diff --git a/lib/librte_eal/common/malloc_mp.c b/lib/librte_eal/common/malloc_mp.c index dd814ef53a..f9d558ba64 100644 --- a/lib/librte_eal/common/malloc_mp.c +++ b/lib/librte_eal/common/malloc_mp.c @@ -186,7 +186,7 @@ handle_alloc_request(const struct malloc_mp_req *m, void *map_addr; alloc_sz = RTE_ALIGN_CEIL(ar->align + ar->elt_size + - MALLOC_ELEM_TRAILER_LEN, ar->page_sz); + MALLOC_ELEM_OVERHEAD, ar->page_sz); n_segs = alloc_sz / ar->page_sz; heap = ar->heap; -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-20 15:00:59.929132765 +0800 +++ 0025-malloc-fix-allocation-of-almost-hugepage-size.patch 2022-07-20 15:00:58.711000496 +0800 @@ -1 +1 @@ -From ce2f7d472e80c1b6779f230a1c7b137157f5ff3d Mon Sep 17 00:00:00 2001 +From dbbdee4c12fca634bf094e703465cb59eba8ca51 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit ce2f7d472e80c1b6779f230a1c7b137157f5ff3d ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -20,2 +22,2 @@ - lib/eal/common/malloc_heap.c | 2 +- - lib/eal/common/malloc_mp.c | 2 +- + lib/librte_eal/common/malloc_heap.c | 2 +- + lib/librte_eal/common/malloc_mp.c | 2 +- @@ -24,5 +26,5 @@ -diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c -index a3d26fcbea..27a52266ad 100644 ---- a/lib/eal/common/malloc_heap.c -+++ b/lib/eal/common/malloc_heap.c -@@ -403,7 +403,7 @@ try_expand_heap_primary(struct malloc_heap *heap, uint64_t pg_sz, +diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c +index 350ff97ee0..f4e20eab92 100644 +--- a/lib/librte_eal/common/malloc_heap.c ++++ b/lib/librte_eal/common/malloc_heap.c +@@ -397,7 +397,7 @@ try_expand_heap_primary(struct malloc_heap *heap, uint64_t pg_sz, @@ -37,6 +39,6 @@ -diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c -index 207b90847e..2b8eb51067 100644 ---- a/lib/eal/common/malloc_mp.c -+++ b/lib/eal/common/malloc_mp.c -@@ -250,7 +250,7 @@ handle_alloc_request(const struct malloc_mp_req *m, - } +diff --git a/lib/librte_eal/common/malloc_mp.c b/lib/librte_eal/common/malloc_mp.c +index dd814ef53a..f9d558ba64 100644 +--- a/lib/librte_eal/common/malloc_mp.c ++++ b/lib/librte_eal/common/malloc_mp.c +@@ -186,7 +186,7 @@ handle_alloc_request(const struct malloc_mp_req *m, + void *map_addr; @@ -49 +51 @@ - /* we can't know in advance how many pages we'll need, so we malloc */ + heap = ar->heap;