From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 5364B98 for ; Tue, 24 Jul 2018 12:24:46 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 01E0F21DA6; Tue, 24 Jul 2018 06:24:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 24 Jul 2018 06:24:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=qLO8uGkzDMjqn7LvV7XwoNKpnz pnr0Qa8ZzwEDC54ZI=; b=Cagd+g9eUyhw1VU1w7oSH0xX/gN3Y9V0MMPbnlJJ1v KxGaesPpqvluDQSU9bSvXyzroh1A3ZOuvuNp4eJnyTroajbuCtT7tk21xUfShOpl R8opozFdDCz9Je90UF/gd59akUdfjKLzu2tgEHyrnCWrorTOxpTA7Sz6ArXszICW I= 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-sender:x-me-sender:x-sasl-enc; s=fm3; bh=qLO8uG kzDMjqn7LvV7XwoNKpnzpnr0Qa8ZzwEDC54ZI=; b=Xditbfx3Kf/T0JDr8baIeo jMnCYrCTUwwb1HvmddNdMGUf9IhpCPVD8DyxdRnLw09Y9knXB+6e3BbT7TL/hOMW 4RfLL3+hdl7eRldYeSLp7U5/q4OaX4JNPYGAvWBkAFKQUdNDAEsBu9HRp9dh+jrN I4tTgsukz9pRWw27HVVH3i9nuq8pPlU9YjtzUsa2CQ7IavWLDgKWtX4wdkIJij+F /uNkVcw/aIU4Ge6q3W1lr4FTFBepR9Kro5rHf2iNaDn/ZfXNfXfrFWt2kBze+yn0 g/hufJccmmmczJ3owLtqYX/1w+36wu7wSTn2vzQbH+pwTowVM7C/3JBpfMnviW6g == X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6316DE4314; Tue, 24 Jul 2018 06:24:45 -0400 (EDT) From: Thomas Monjalon To: "Burakov, Anatoly" Cc: dev@dpdk.org Date: Tue, 24 Jul 2018 12:24:40 +0200 Message-ID: <5303347.Rbc4TJUbQV@xps> In-Reply-To: <1f5ef2a7-739e-b90f-8b04-a2a0abe234fa@intel.com> References: <914a5f584be81d6c129b35bc8e358774854d8960.1528749451.git.anatoly.burakov@intel.com> <1f5ef2a7-739e-b90f-8b04-a2a0abe234fa@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 9/9] memalloc: allocate memory in reverse 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: , X-List-Received-Date: Tue, 24 Jul 2018 10:24:46 -0000 24/07/2018 12:10, Burakov, Anatoly: > On 11-Jun-18 9:55 PM, Anatoly Burakov wrote: > > Currently, all hugepages are allocated from lower VA address to > > higher VA address, while malloc heap allocates from higher VA > > address to lower VA address. This results in heap fragmentation > > over time due to multiple reserves leaving small space below the > > allocated elements. > > > > Fix this by allocating VA memory from the top, thereby reducing > > fragmentation and lowering overall memory usage. > > > > Signed-off-by: Anatoly Burakov > > --- > > lib/librte_eal/linuxapp/eal/eal_memalloc.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c > > index 8c11f98c9..d35fb52c4 100644 > > --- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c > > +++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c > > @@ -682,7 +682,8 @@ alloc_seg_walk(const struct rte_memseg_list *msl, void *arg) > > need = wa->n_segs; > > > > /* try finding space in memseg list */ > > - cur_idx = rte_fbarray_find_next_n_free(&cur_msl->memseg_arr, 0, need); > > + cur_idx = rte_fbarray_find_prev_n_free(&cur_msl->memseg_arr, > > + cur_msl->memseg_arr.len - 1, need); > > if (cur_idx < 0) > > return 0; > > start_idx = cur_idx; > > > > Hi Thomas, > > We have discovered a few regressions in virtio/vhost use cases due to > this patch. Virtio expects to map all segments starting from 0 address, > and this patch breaks that assumption. > > Can we revert this for 18.08? It will be reintroduced in 18.11 along > with fixes for virtio/vhost fixes to account for this change. Yes, please send the patch with explanations.