ebpf的主从同步实现,QPS测试与内存池QPS测试。
This commit is contained in:
@@ -6,11 +6,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define MEMPOOL_PAGE_SIZE 4096
|
||||
// #define MEMPOOL_PAGE_SIZE 4096
|
||||
#define MEMPOOL_PAGE_SIZE (1024*8)
|
||||
#define MEMPOOL_BLOCK_MAX_SIZE 512
|
||||
#define MEMPOOL_ALIGNMENT 8
|
||||
#define MEMPOOL_NUM_CLASSES (MEMPOOL_BLOCK_MAX_SIZE / MEMPOOL_ALIGNMENT)
|
||||
#define MEMPOOL_CACHE_PAGE 2
|
||||
#define MEMPOOL_CACHE_PAGE 4
|
||||
|
||||
typedef struct mp_page_s mp_page_t;
|
||||
typedef struct mp_bucket_s mp_bucket_t;
|
||||
@@ -34,7 +35,7 @@ struct mp_page_s{
|
||||
uint16_t free_count;
|
||||
uint16_t capacity;
|
||||
|
||||
uint64_t bitmap[8]; // 最多支持 512 个块 (64*8)
|
||||
uint64_t bitmap[20]; // 最多支持 512/1280 个块 (64*20)
|
||||
};
|
||||
|
||||
struct mp_bucket_s{
|
||||
|
||||
Reference in New Issue
Block a user