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 35E15A0526; Wed, 22 Jul 2020 01:27:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D49381C0C5; Wed, 22 Jul 2020 01:27:11 +0200 (CEST) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by dpdk.org (Postfix) with ESMTP id A9B8F1C0B6; Wed, 22 Jul 2020 01:27:09 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 24095DD3; Tue, 21 Jul 2020 19:27:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Tue, 21 Jul 2020 19:27:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= igdMNF0iyA3uoOLs1mkE0y2tZni/MWufN/aRBFJVcVE=; b=bwipyJqhBVtwtiRB iJ7BZtWM5FD+FeCgdWbyzqfrcCoS6ByGi6tME/eCE8P6n2YSav9uUlxmCn0k+TOs d/3zVsgpBzH9VZBsNg/JU8lI1Tf817ZwhMsY9yC8dmK7X0J9wQ/owa1SBdoL2R6R PjPuF6K0B+eIaLR1Cz/hBLhJL0IApnnBxhAZfvqDcI6jlfqVpr5T0zXPDgincnXB DLrX3FZcK8ZDQQCGSSrvx+ET7T9B4p4kqTtUDpG2lNimr5kE1npsj1KVDzB5PzNA Rg4HFuzLUmPNTie7qV14TzbS4gMVXfcxa0xWzQmFYI4iO80IIhknToW0x0UiUqcn JIDcfA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=igdMNF0iyA3uoOLs1mkE0y2tZni/MWufN/aRBFJVc VE=; b=nCIJVeI+gRyBvPMK+r2g2kpfJ49x5GVMrOWl0pzPaSnjNBUIuDe7HCBMC X8pAG31MinJxt9rwA46B2I+ckMidx9XaRa83YlaxxaQXSGElqe11KaWSkc2Gvejs Kfe+doPA9VEY1u9KO08UXvi5jEx3luMF6+Daadl8mMXNwDP4j129W1wb6tLd2YUE dWT8qvzBhauf/i9mAQwhnhgyllJoiBrdkW0aNLhfUFWskVoPiD5cCUBNDxbsxud0 lj65AHywX4/Ayk+l1TWM6XUK0I+BYJ5npbMOCiBzvlp0mTjtF0Crz1+UdDJHKNhM iFx0N1UGeNNLcVd0K2n1VrIjFz7lQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrgeekgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 7932F3280063; Tue, 21 Jul 2020 19:27:05 -0400 (EDT) From: Thomas Monjalon To: Zhike Wang Cc: dev@dpdk.org, olivier.matz@6wind.com, arybchenko@solarflare.com, stable@dpdk.org, "Burakov, Anatoly" Date: Wed, 22 Jul 2020 01:27:02 +0200 Message-ID: <8720199.fGh7NnkD9j@thomas> In-Reply-To: <0256a601-f2d2-2621-0ab4-1a1d0b7b932b@intel.com> References: <1594611634-7730-1-git-send-email-wangzhike@jd.com> <1594711565-28309-1-git-send-email-wangzhike@jd.com> <0256a601-f2d2-2621-0ab4-1a1d0b7b932b@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] mempool: fix memory allocation in memzones during retry. 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" 14/07/2020 11:32, Burakov, Anatoly: > On 14-Jul-20 8:26 AM, Zhike Wang wrote: > > If allocation is successful on the first attempt, typically > > there is no problem since we allocated everything required and > > we'll terminate the loop (if memory chunk is really sufficient > > to populate required number of mempool elements). > > > > If the first attempt fails, we try to allocate half > > of mem_size and it succeed, we'll have one more iteration of > > the for-loop to allocate memory for remaining elements and > > should not try the next time with quarter of the mem_size. > > > > It is wrong that max_alloc_size is divided by 2 in the > > case of successful allocation as well, or invalid memory > > can be allocated, and leads to population failure, then errno > > other than ENOMEM may be returned. > > > > Fixes: 3a3d0c75b43e ("mempool: fix slow allocation of large pools") Cc: stable@dpdk.org > > Signed-off-by: Andrew Rybchenko > > Signed-off-by: Zhike Wang > > Acked-by: Anatoly Burakov Applied, thanks