ganeshmurthy commented on a change in pull request #525: DISPATCH-1372 
alloc_pool intrusive linked list can be replaced by a linked stack
URL: https://github.com/apache/qpid-dispatch/pull/525#discussion_r298281051
 
 

 ##########
 File path: src/alloc_pool.c
 ##########
 @@ -44,20 +46,142 @@ DEQ_DECLARE(qd_alloc_type_t, qd_alloc_type_list_t);
 #define PATTERN_BACK  0xbabecafe
 
 struct qd_alloc_item_t {
-    DEQ_LINKS(qd_alloc_item_t);
     uint32_t              sequence;
 #ifdef QD_MEMORY_DEBUG
     qd_alloc_type_desc_t *desc;
     uint32_t              header;
 #endif
 };
 
-DEQ_DECLARE(qd_alloc_item_t, qd_alloc_item_list_t);
+//128 has been chosen because many CPUs arch use an
+//adiacent line prefetching optimization that load
+//2*cache line bytes in batch
+#define CHUNK_SIZE 128/sizeof(void*)
 
+struct qd_alloc_chunk_t {
 
 Review comment:
   So assuming sizeof(void*) in a 64 bit machine is 8, 128/8 = 16
   qd_alloc_chunk_t will have 
   1. 8 bytes for prev
   2. 16 items (qd_alloc_item_ts)
   3. 8 bytes for next
   ======================
   Total = 128 + 16 = 144 bytes. 
   =======================
   But Adjacent Cache-Line Prefetch size ie 128 bytes. Looks like 144 bytes 
will not fit into one Adjacent Cache-Line Prefetch. So, does it make sense to 
move "items" as the first member of qd_alloc_chunk_t in which case we could use 
the DEQ for prev and next
    

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to