]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: poller: move the call of tv_update_date() back to the pollers
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Nov 2018 17:57:37 +0000 (18:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Nov 2018 17:57:37 +0000 (18:57 +0100)
The reason behind this will be to be able to compute a timeout when
busy polling.

include/common/time.h
src/ev_epoll.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c

index b9efd714b9b8ffbefc3076380fca3da4ac284996..c3f8f5c9e4ac4b06dd387efc02b478f7aa54ba24 100644 (file)
@@ -586,7 +586,6 @@ static inline void tv_entering_poll()
  */
 static inline void tv_leaving_poll(int timeout, int interrupted)
 {
-       tv_update_date(timeout, interrupted);
        measure_idle();
        prev_cpu_time  = now_cpu_time();
        prev_mono_time = now_mono_time();
index a9f96ab800c9e582574cc53089772280aeb55686..272ded2b437c2764a12229570642d9095c5421cd 100644 (file)
@@ -150,6 +150,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
        tv_entering_poll();
        activity_count_runtime();
        status = epoll_wait(epoll_fd[tid], epoll_events, global.tune.maxpollevents, wait_time);
+       tv_update_date(wait_time, status);
        tv_leaving_poll(wait_time, status);
 
        thread_harmless_end();
index dc1310cff8234153af4e386ac0b1b93f81e0293b..a894f66870975f5bb21b1387eebc3d2c434799cb 100644 (file)
@@ -143,6 +143,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                        kev,       // struct kevent *eventlist
                        fd,        // int nevents
                        &timeout); // const struct timespec *timeout
+       tv_update_date(delta_ms, status);
        tv_leaving_poll(delta_ms, status);
 
        thread_harmless_end();
index ce5e38f96e60a4e48541af5deee850cc0e9a50a7..40bde873b5ddd9c90914b1af7adc5b18b9fdd4b5 100644 (file)
@@ -198,6 +198,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
        tv_entering_poll();
        activity_count_runtime();
        status = poll(poll_events, nbfd, wait_time);
+       tv_update_date(wait_time, status);
        tv_leaving_poll(wait_time, status);
 
        thread_harmless_end();
index f435813aaa2cb2703ebbb36ff95b0ead3e1bd731..f9b1215895a6d4d94bb098837e9144bc61f3081c 100644 (file)
@@ -172,6 +172,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                        writenotnull ? tmp_evts[DIR_WR] : NULL,
                        NULL,
                        &delta);
+       tv_update_date(delta_ms, status);
        tv_leaving_poll(delta_ms, status);
 
        thread_harmless_end();