From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: remy.horton@intel.com
Subject: [dpdk-dev] [PATCH v4 0/3] Improve zero-length memzone allocation
Date: Mon, 14 May 2018 12:19:52 +0100 [thread overview]
Message-ID: <cover.1526296329.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <cover.1525366407.git.anatoly.burakov@intel.com>
This patchset does two things. First, it enables reserving
memzones of zero-length that are IOVA-contiguous. Second,
it fixes a long-standing race condition in reserving
zero-length memzones, where malloc heap is not locked between
stats collection and reservation, and will instead allocate
biggest element on the spot.
Some limitations are added, but they are a trade-off between
not having race conditions and user convenience. It would be
possible to lock all heaps during memzone reserve for zero-
length, and that would keep the old behavior, but given how
such allocation (especially when asking for IOVA-contiguous
memory) may take a long time, a design decision was made to
keep things simple, and only check other heaps if the
current one is completely busy.
Ideas on improvement are welcome.
v4:
- Fixes in memzone test
- Account for element padding
- Fix for wrong memzone size being returned
- Documentation fixes
Anatoly Burakov (3):
malloc: add biggest free IOVA-contiguous element to stats
malloc: allow reserving biggest element
memzone: improve zero-length memzone reserve
lib/librte_eal/common/eal_common_memzone.c | 68 +++---------
lib/librte_eal/common/include/rte_malloc.h | 1 +
lib/librte_eal/common/include/rte_memzone.h | 21 ++++
lib/librte_eal/common/malloc_elem.c | 79 +++++++++++++
lib/librte_eal/common/malloc_elem.h | 6 +
lib/librte_eal/common/malloc_heap.c | 137 +++++++++++++++++++++++
lib/librte_eal/common/malloc_heap.h | 4 +
lib/librte_eal/common/rte_malloc.c | 2 +
test/test/test_memzone.c | 165 ++++++++++++++++------------
9 files changed, 358 insertions(+), 125 deletions(-)
--
2.7.4
next prev parent reply other threads:[~2018-05-14 11:19 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 14:10 [dpdk-dev] [PATCH 1/2] malloc: add biggest free IOVA-contiguous element to stats Anatoly Burakov
2018-04-25 14:10 ` [dpdk-dev] [PATCH 2/2] memzone: allow IOVA-contiguous memzones with zero size Anatoly Burakov
2018-04-25 14:40 ` [dpdk-dev] [PATCH 1/2] malloc: add biggest free IOVA-contiguous element to stats Burakov, Anatoly
2018-04-26 8:06 ` [dpdk-dev] [PATCH v2 " Anatoly Burakov
2018-05-03 17:17 ` [dpdk-dev] [PATCH v3 0/3] Improve zero-length memzone allocation Anatoly Burakov
2018-05-14 11:19 ` Anatoly Burakov [this message]
2018-05-14 13:47 ` [dpdk-dev] [PATCH v5 " Anatoly Burakov
2018-05-31 9:50 ` [dpdk-dev] [PATCH v6 " Anatoly Burakov
2018-07-13 9:24 ` Thomas Monjalon
2018-05-31 9:50 ` [dpdk-dev] [PATCH v6 1/3] malloc: add finding biggest free IOVA-contiguous element Anatoly Burakov
2018-05-31 9:51 ` [dpdk-dev] [PATCH v6 2/3] malloc: allow reserving biggest element Anatoly Burakov
2018-05-31 9:51 ` [dpdk-dev] [PATCH v6 3/3] memzone: improve zero-length memzone reserve Anatoly Burakov
2018-05-14 13:47 ` [dpdk-dev] [PATCH v5 1/3] malloc: add biggest free IOVA-contiguous element to stats Anatoly Burakov
2018-05-14 13:58 ` Shreyansh Jain
2018-05-14 13:47 ` [dpdk-dev] [PATCH v5 2/3] malloc: allow reserving biggest element Anatoly Burakov
2018-05-14 13:47 ` [dpdk-dev] [PATCH v5 3/3] memzone: improve zero-length memzone reserve Anatoly Burakov
2018-05-14 11:19 ` [dpdk-dev] [PATCH v4 1/3] malloc: add biggest free IOVA-contiguous element to stats Anatoly Burakov
2018-05-14 11:19 ` [dpdk-dev] [PATCH v4 2/3] malloc: allow reserving biggest element Anatoly Burakov
2018-05-14 11:19 ` [dpdk-dev] [PATCH v4 3/3] memzone: improve zero-length memzone reserve Anatoly Burakov
2018-05-03 17:17 ` [dpdk-dev] [PATCH v3 1/3] malloc: add biggest free IOVA-contiguous element to stats Anatoly Burakov
2018-05-10 13:39 ` Remy Horton
2018-05-03 17:18 ` [dpdk-dev] [PATCH v3 2/3] malloc: allow reserving biggest element Anatoly Burakov
2018-05-10 13:57 ` Remy Horton
2018-05-14 8:22 ` Burakov, Anatoly
2018-05-03 17:18 ` [dpdk-dev] [PATCH v3 3/3] memzone: improve zero-length memzone reserve Anatoly Burakov
2018-05-11 10:25 ` Remy Horton
2018-05-14 8:21 ` Burakov, Anatoly
2018-05-14 11:29 ` Burakov, Anatoly
2018-05-14 12:23 ` Burakov, Anatoly
2018-05-15 6:24 ` Remy Horton
2018-05-15 8:37 ` Burakov, Anatoly
2018-04-26 8:06 ` [dpdk-dev] [PATCH v2 2/2] memzone: allow IOVA-contiguous memzones with zero size Anatoly Burakov
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.1526296329.git.anatoly.burakov@intel.com \
--to=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=remy.horton@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).