From 8ad90092f4d32641611e671f257109a4911d61b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Vavru=C5=A1a?= Date: Sat, 27 Jun 2015 21:51:36 +0200 Subject: [PATCH] lib: turned some knobs --- daemon/worker.c | 14 +++++++------- lib/nsrep.c | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/daemon/worker.c b/daemon/worker.c index bd6d518ca..bfcfd1dc9 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -140,15 +140,15 @@ static void qr_task_free(uv_handle_t *handle) array_push(worker->pools, mp_context); } else { mp_delete(mp_context); + } #if defined(__GLIBC__) && defined(_GNU_SOURCE) - /* Decommit memory every once in a while */ - static size_t mp_delete_count = 0; - if (++mp_delete_count == 100 * MP_FREELIST_SIZE) { - malloc_trim(0); - mp_delete_count = 0; - } -#endif + /* Decommit memory every once in a while */ + static size_t mp_delete_count = 0; + if (++mp_delete_count == 100 * MP_FREELIST_SIZE) { + malloc_trim(0); + mp_delete_count = 0; } +#endif } static void qr_task_timeout(uv_timer_t *req) diff --git a/lib/nsrep.c b/lib/nsrep.c index cb315d72d..ab015603f 100644 --- a/lib/nsrep.c +++ b/lib/nsrep.c @@ -123,8 +123,8 @@ static int eval_nsrep(const char *k, void *v, void *baton) update_nsrep(ns, (const knot_dname_t *)k, addr, score); ns->reputation = reputation; } else { - /* With 10% chance, probe server with a probability given by its RTT / MAX_RTT */ - if ((kr_rand_uint(100) < 10) && (kr_rand_uint(KR_NS_MAX_SCORE) >= score)) { + /* With 5% chance, probe server with a probability given by its RTT / MAX_RTT */ + if ((kr_rand_uint(100) < 5) && (kr_rand_uint(KR_NS_MAX_SCORE) >= score)) { /* If this is a low-reliability probe, go with TCP to get ICMP reachability check. */ if (score >= KR_NS_LONG) { qry->flags |= QUERY_TCP; -- 2.47.2