]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/worker: compile-time support for recvmmsg in worker buffers
authorMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 8 Jul 2015 01:36:02 +0000 (03:36 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 8 Jul 2015 01:36:02 +0000 (03:36 +0200)
daemon/engine.h
daemon/worker.c
daemon/worker.h

index e82474cd9054552c1afcf84cb2353a2912ad7e37..13dc097b13455287bffe4f3883924edff6181ce2 100644 (file)
@@ -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.
index 63f4dad13b045c2e0c9d427a45970f2950ee4d7c..d5dc65ee1c80731bb96a11af929410fd73fe5cd4 100644 (file)
@@ -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 */
index ca627d5f446f64b927ec2df0437142830c2db3a0..233c865b70f51df20715d489f3d62a64f89e9e1f 100644 (file)
@@ -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;
 };
 
 /**