]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: activity/fd: remove the dead_fd counter
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Aug 2021 08:59:50 +0000 (10:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Aug 2021 14:03:36 +0000 (16:03 +0200)
This one is set whenever an FD is reported by a poller with a null owner,
regardless of the thread_mask. It has become totally meaningless because
it only indicates a migrated FD that was not yet reassigned to a thread,
but as soon as a thread uses it, the status will change to skip_fd. Thus
there is no reason to distinguish between the two, it adds more confusion
than it helps. Let's simply drop it.

include/haproxy/activity-t.h
include/haproxy/fd-t.h
src/cli.c
src/fd.c

index 02fd2f34e641806a6c64448bb1b1e10e4398932b..63779ff9ab19d8ecfc8f1f2a9ce1a9ff743fbd43 100644 (file)
@@ -46,7 +46,6 @@ struct activity {
        unsigned int poll_io;      // number of times poll() reported I/O events
        unsigned int poll_exp;     // number of times poll() sees an expired timeout (includes wake_*)
        unsigned int poll_drop_fd; // poller dropped a dead FD from the update list
-       unsigned int poll_dead_fd; // poller woke up with a dead FD
        unsigned int poll_skip_fd; // poller skipped another thread's FD
        unsigned int conn_dead;    // conn_fd_handler woke up on an FD indicating a dead connection
        unsigned int stream_calls; // calls to process_stream()
index 99231503a29fd3dab2e414a4a95cde883f7861fd..1e318254e4a37fb2141af2b79e7758824d85793c 100644 (file)
@@ -113,7 +113,6 @@ enum {
 /* FD update status after fd_update_events() */
 enum {
        FD_UPDT_DONE = 0,    // update done, nothing else to be done
-       FD_UPDT_DEAD,        // FD was already dead, ignore it
        FD_UPDT_CLOSED,      // FD was closed
        FD_UPDT_MIGRATED,    // FD was migrated, ignore it now
 };
index d3411ed9e1e5bbeeb5c479f1108d84c917654b23..3bc22cff682ef00d809ff64a0aa563fbc240c07d 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1414,7 +1414,6 @@ static int cli_io_handler_show_activity(struct appctx *appctx)
        chunk_appendf(&trash, "poll_io:");      SHOW_TOT(thr, activity[thr].poll_io);
        chunk_appendf(&trash, "poll_exp:");     SHOW_TOT(thr, activity[thr].poll_exp);
        chunk_appendf(&trash, "poll_drop_fd:"); SHOW_TOT(thr, activity[thr].poll_drop_fd);
-       chunk_appendf(&trash, "poll_dead_fd:"); SHOW_TOT(thr, activity[thr].poll_dead_fd);
        chunk_appendf(&trash, "poll_skip_fd:"); SHOW_TOT(thr, activity[thr].poll_skip_fd);
        chunk_appendf(&trash, "conn_dead:");    SHOW_TOT(thr, activity[thr].conn_dead);
        chunk_appendf(&trash, "stream_calls:"); SHOW_TOT(thr, activity[thr].stream_calls);
index df9b5deb2bf5bfed27ab1774415bb478a6958c00..3ac7e558f966a79bbd33d0ba1b03fd0f05365c59 100644 (file)
--- a/src/fd.c
+++ b/src/fd.c
@@ -459,12 +459,6 @@ int fd_update_events(int fd, uint evts)
 
        ti->flags &= ~TI_FL_STUCK; // this thread is still running
 
-       /* do nothing on remains of an old dead FD */
-       if (!fdtab[fd].owner) {
-               activity[tid].poll_dead_fd++;
-               return FD_UPDT_DEAD;
-       }
-
        /* do nothing if the FD was taken over under us */
        if (fd_set_running(fd) == -1) {
                activity[tid].poll_skip_fd++;