DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, john.mcnamara@intel.com,
	zhihong.wang@intel.com, qian.q.xu@intel.com, yu.y.liu@intel.com,
	lei.a.yao@intel.com
Subject: [dpdk-dev] [PATCH] Revert "mem: allocate in reverse to reduce fragmentation"
Date: Tue, 24 Jul 2018 13:21:40 +0100	[thread overview]
Message-ID: <0957f38f12ba6df24f0b48f24fe8236a6ce50efc.1532434698.git.anatoly.burakov@intel.com> (raw)

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

             reply	other threads:[~2018-07-24 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 12:21 Anatoly Burakov [this message]
2018-07-26  9:18 ` Thomas Monjalon
2018-07-26  9:30   ` Burakov, Anatoly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0957f38f12ba6df24f0b48f24fe8236a6ce50efc.1532434698.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=lei.a.yao@intel.com \
    --cc=qian.q.xu@intel.com \
    --cc=thomas@monjalon.net \
    --cc=yu.y.liu@intel.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).