From: Thomas Monjalon <thomas@monjalon.net>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 9/9] memalloc: allocate memory in reverse
Date: Tue, 24 Jul 2018 12:24:40 +0200 [thread overview]
Message-ID: <5303347.Rbc4TJUbQV@xps> (raw)
In-Reply-To: <1f5ef2a7-739e-b90f-8b04-a2a0abe234fa@intel.com>
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 <anatoly.burakov@intel.com>
> > ---
> > 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.
next prev parent reply other threads:[~2018-07-24 10:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 20:55 [dpdk-dev] [PATCH 0/9] mem: reduce memory fragmentation Anatoly Burakov
2018-06-11 20:55 ` [dpdk-dev] [PATCH 1/9] fbarray: fix errno values returned from functions Anatoly Burakov
2018-06-11 20:55 ` [dpdk-dev] [PATCH 2/9] fbarray: reduce duplication in find_contig code Anatoly Burakov
2018-06-11 20:55 ` [dpdk-dev] [PATCH 3/9] fbarray: reduce duplication in find_next_n code Anatoly Burakov
2018-06-11 20:55 ` [dpdk-dev] [PATCH 4/9] fbarray: reduce duplication in find_next code Anatoly Burakov
2018-06-11 20:55 ` [dpdk-dev] [PATCH 5/9] fbarray: add reverse find_free/used Anatoly Burakov
2018-06-11 20:55 ` [dpdk-dev] [PATCH 6/9] fbarray: add reverse find n used/free Anatoly Burakov
2018-06-11 20:55 ` [dpdk-dev] [PATCH 7/9] fbarray: add reverse find contig used/free Anatoly Burakov
2018-06-11 20:55 ` [dpdk-dev] [PATCH 8/9] test: add fbarray autotests Anatoly Burakov
2018-06-11 20:55 ` [dpdk-dev] [PATCH 9/9] memalloc: allocate memory in reverse Anatoly Burakov
2018-07-24 10:10 ` Burakov, Anatoly
2018-07-24 10:24 ` Thomas Monjalon [this message]
2018-07-13 9:06 ` [dpdk-dev] [PATCH 0/9] mem: reduce memory fragmentation Thomas Monjalon
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=5303347.Rbc4TJUbQV@xps \
--to=thomas@monjalon.net \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
/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).