Since we're now caching the local thread ID for cache management, use
this copy for buffer allocation marking as well to avoid unneeded calls
to odp_thread_id()

Signed-off-by: Bill Fischofer <bill.fischo...@linaro.org>
---
 platform/linux-generic/include/odp_pool_internal.h | 2 --
 platform/linux-generic/odp_pool.c                  | 3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/platform/linux-generic/include/odp_pool_internal.h 
b/platform/linux-generic/include/odp_pool_internal.h
index 94bf1fa..fb51119 100644
--- a/platform/linux-generic/include/odp_pool_internal.h
+++ b/platform/linux-generic/include/odp_pool_internal.h
@@ -214,7 +214,6 @@ static inline odp_buffer_hdr_t *get_buf(struct pool_entry_s 
*pool)
                }
 
                odp_atomic_inc_u64(&pool->poolstats.bufallocs);
-               myhead->allocator = odp_thread_id();
        }
 
        return (void *)myhead;
@@ -276,7 +275,6 @@ static inline void *get_local_buf(local_cache_t *buf_cache,
                }
 
                buf_cache->bufallocs++;
-               buf->allocator = odp_thread_id();  /* Mark buffer allocated */
        }
 
        return buf;
diff --git a/platform/linux-generic/odp_pool.c 
b/platform/linux-generic/odp_pool.c
index 9fd64d6..638b387 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -520,6 +520,9 @@ odp_buffer_t buffer_alloc(odp_pool_t pool_hdl, size_t size)
                }
        }
 
+       /* Mark buffer as allocated */
+       buf->buf.allocator = local_id;
+
        /* By default, buffers inherit their pool's zeroization setting */
        buf->buf.flags.zeroized = pool->s.flags.zeroized;
 
-- 
2.1.4

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to