Commit b3f528f7 authored by Marek Vavruša's avatar Marek Vavruša

daemon/worker: compile-time support for recvmmsg in worker buffers

parent dacc510f
......@@ -26,6 +26,9 @@
#ifndef MP_FREELIST_SIZE
#define MP_FREELIST_SIZE 32 /**< Maximum length of the worker mempool freelist */
#endif
#ifndef RECVMMSG_BATCH
#define RECVMMSG_BATCH 8
#endif
/*
* @internal These are forward decls to allow building modules with engine but without Lua.
......
......@@ -75,7 +75,7 @@ static struct qr_task *qr_task_create(struct worker_ctx *worker, uv_handle_t *ha
pool.ctx = array_tail(worker->pools);
array_pop(worker->pools);
} else { /* No mempool on the freelist, create new one */
pool.ctx = mp_new (16 * CPU_PAGE_SIZE);
pool.ctx = mp_new (20 * CPU_PAGE_SIZE);
}
/* Create worker task */
......
......@@ -32,13 +32,18 @@ struct worker_ctx {
struct engine *engine;
uv_loop_t *loop;
mm_ctx_t *mm;
uint8_t wire_buf[4 * KNOT_WIRE_MAX_PKTSIZE];
#if __linux__
uint8_t wire_buf[RECVMMSG_BATCH * KNOT_WIRE_MAX_PKTSIZE];
#else
uint8_t wire_buf[KNOT_WIRE_MAX_PKTSIZE];
#endif
struct {
size_t concurrent;
size_t udp;
size_t tcp;
} stats;
mp_freelist_t pools;
mp_freelist_t ioreqs;
};
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment