DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] Revert "mem: allocate in reverse to reduce fragmentation"
@ 2018-07-24 12:21 Anatoly Burakov
  2018-07-26  9:18 ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoly Burakov @ 2018-07-24 12:21 UTC (permalink / raw)
  To: dev; +Cc: thomas, john.mcnamara, zhihong.wang, qian.q.xu, yu.y.liu, lei.a.yao

This reverts commit 179f916e88e4a0fdd5ad4d20e226771d3d271c41.

A few regressions with virtio/vhost have been discovered, due to the
strong dependency of virtio/vhost on the underlying memory layout.
Specifically, virtio/vhost share all memory pages starting from the
beginning of the segment, while the patch above made it so that the
memory is always allocated from the top of VA space, not from the
bottom.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/linuxapp/eal/eal_memalloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c
index a59f229cd..aa95551a8 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c
@@ -731,8 +731,7 @@ 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_prev_n_free(&cur_msl->memseg_arr,
-			cur_msl->memseg_arr.len - 1, need);
+	cur_idx = rte_fbarray_find_next_n_free(&cur_msl->memseg_arr, 0, need);
 	if (cur_idx < 0)
 		return 0;
 	start_idx = cur_idx;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-26  9:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-24 12:21 [dpdk-dev] [PATCH] Revert "mem: allocate in reverse to reduce fragmentation" Anatoly Burakov
2018-07-26  9:18 ` Thomas Monjalon
2018-07-26  9:30   ` Burakov, Anatoly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).