From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 0/9] mem: reduce memory fragmentation
Date: Mon, 11 Jun 2018 21:55:33 +0100 [thread overview]
Message-ID: <cover.1528749451.git.anatoly.burakov@intel.com> (raw)
This patchset is mostly dealing with changes fbarray, but it is
actually about reducing fragmentation in Linuxapp memalloc.
We allocate hugepages from lower VA to higher VA. However, our
malloc heap allocates addresses from higher VA to lower VA. This
results in a situation where, whenever new page is allocated,
malloc starts to allocate memory from the top, leaving fragmented
space between new allocation's leftover and previous leftover.
Over time, this leads to lots of free elements sitting at page
boundaries, small enough to be useful but large enough to have an
impact on memory fragmentation in certain circumstances.
To fix this, we need to allocate memory from higher VA first.
However, in order to do that, we need the ability to search fbarray
in reverse, which is currently not supported. Adding this support is
what most of this patchset is about.
First 4 patches fix some issues in existing fbarray implementation
and remove some code duplication, preparing for adding of new
functionality.
Next 3 patches add new functionality - reverse search of used/free
slots, mirroring already existing functionality in semantics and
capable of returning identical results but in reverse order.
Patch 8 adds unit tests for fbarray, testing both existing and new
functionality.
Finally, patch 9 changes memalloc to look up free slots in memseg
list in reverse order. No other changes is necessary, as all other
code can handle segments, wherever they are allocated.
Anatoly Burakov (9):
fbarray: fix errno values returned from functions
fbarray: reduce duplication in find_contig code
fbarray: reduce duplication in find_next_n code
fbarray: reduce duplication in find_next code
fbarray: add reverse find_free/used
fbarray: add reverse find n used/free
fbarray: add reverse find contig used/free
test: add fbarray autotests
memalloc: allocate memory in reverse
lib/librte_eal/common/eal_common_fbarray.c | 493 ++++++++++++++---
lib/librte_eal/common/include/rte_fbarray.h | 114 ++++
lib/librte_eal/linuxapp/eal/eal_memalloc.c | 3 +-
lib/librte_eal/rte_eal_version.map | 6 +
test/test/Makefile | 1 +
test/test/test_fbarray.c | 576 ++++++++++++++++++++
6 files changed, 1119 insertions(+), 74 deletions(-)
create mode 100644 test/test/test_fbarray.c
--
2.17.1
next reply other threads:[~2018-06-11 20:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 20:55 Anatoly Burakov [this message]
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
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=cover.1528749451.git.anatoly.burakov@intel.com \
--to=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).