[PATCH v2] linux-gen: pool: optimize single event alloc/free operations#2318
Merged
MatiasElo merged 3 commits intoOpenDataPlane:masterfrom Mar 18, 2026
Merged
Conversation
Comment on lines
+1474
to
+1485
| if (odp_unlikely(cache_size == cache_num)) { | ||
| const uint32_t burst = pool->burst_size; | ||
| _odp_event_hdr_t *ev_hdr[burst]; | ||
| ring_mpmc_rst_ptr_t *ring = &pool->ring->hdr; | ||
| uint32_t mask = pool->ring_mask; | ||
|
|
||
| cache_pop(cache, ev_hdr, burst); | ||
|
|
||
| ring_mpmc_rst_ptr_enq_multi(ring, mask, (void **)ev_hdr, burst); | ||
| if (CONFIG_POOL_STATISTICS && pool->params.stats.bit.free_ops) | ||
| odp_atomic_inc_u64(&pool->stats.free_ops); | ||
| } |
Collaborator
There was a problem hiding this comment.
I wonder which is more optimal, keep cache full for subsequent allocations and free the single event to global pool vs. this.
Collaborator
There was a problem hiding this comment.
Maybe flush half the cache or so to the global pool,?
Collaborator
Author
There was a problem hiding this comment.
The burst size comes from a config file option (pool:burst_size), so I'd prefer keeping it as is for now.
Optimize implementation of internal single event specific _odp_event_free() function, which is used to implement several API functions. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Optimize implementation of internal single event specific _odp_event_alloc() function, which is used to implement several API functions. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Use single event alloc function in odp_buffer_alloc() implementation. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
565e9ff to
1197f87
Compare
TuomasTaipale
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.