RFC v3: memtank, first draft 34/20534/6
authorKonstantin Ananyev <konstantin.ananyev@intel.com>
Thu, 27 Jun 2019 18:28:26 +0000 (19:28 +0100)
committerKonstantin Ananyev <konstantin.ananyev@intel.com>
Wed, 14 Aug 2019 07:05:43 +0000 (07:05 +0000)
commit29e2be931e1f813e28c6097697fc58275932f50e
treeb13b5b13256460f83d00c36b0310fee0166e0c77
parente4380f4866091fd92a7a57667dd938a99144f9cd
RFC v3: memtank, first draft

For analogy with mempool, named this structure memtank.
Same a s mempool it allows to alloc/free objects of fixed size
in a lightweight manner (not as lightweight as mempool,
but hopefully close enough).
The whole idea is that alloc/free is used at fast-path and don't
allocate/free more than *min_free* objects at one call.
So for majority of cases our fast-path alloc/free should use
rte_ring enqueue/dequeue calls.
Also user will need to call grow/shrink periodically
(ideally from the slow-path) to make sure there is enough
free objects in the tank.
Internally it is just a simple LIFO for up to *max_free* objects plus
a list of memory buffers (memchunk) from where these objects were
allocated.

v1 -> v2
 - Added UT
 - Fixed few bugs

v2 -> v3
 - extend UT with more parameters

Change-Id: Ibb993453ce67391bb86ad3f3c9bb192f07d7bb35
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/Makefile
lib/libtle_memtank/Makefile [new file with mode: 0644]
lib/libtle_memtank/memtank.c [new file with mode: 0644]
lib/libtle_memtank/tle_memtank.h [new file with mode: 0644]
lib/libtle_memtank/tle_memtank_pub.h [new file with mode: 0644]
test/Makefile
test/memtank/Makefile [new file with mode: 0644]
test/memtank/test_memtank.c [new file with mode: 0644]