]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: listener: remove old thread bit mapping
authorWilly Tarreau <w@1wt.eu>
Tue, 5 Mar 2019 18:25:26 +0000 (19:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 7 Mar 2019 12:59:04 +0000 (13:59 +0100)
Now that the P2C algorithm for the accept queue is removed, we don't
need to map a number to a thread bit anymore, so let's remove all
these fields which are taking quite some space for no reason.

include/types/listener.h
src/cfgparse.c
src/listener.c

index 95f3cc9ad90ca2099c1e758e9fb6e9da399e0747..053b03585aa6095bd4c397c9606cbc62e759c9be 100644 (file)
@@ -170,8 +170,6 @@ struct bind_conf {
        struct list listeners;     /* list of listeners using this bind config */
        unsigned long bind_proc;   /* bitmask of processes allowed to use these listeners */
        unsigned long bind_thread; /* bitmask of threads allowed to use these listeners */
-       unsigned long thr_2, thr_4, thr_8, thr_16; /* intermediate values for bind_thread counting */
-       unsigned int thr_count;    /* #threads bound */
        unsigned int thr_idx;      /* thread indexes for queue distribution : (t2<<16)+t1 */
        uint32_t ns_cip_magic;     /* Excepted NetScaler Client IP magic number */
        struct list by_fe;         /* next binding for the same frontend, or NULL */
index 1a03d97ec75104423e7587de64e81718219b0535..495a25ba222e60c0b8e06cfbb8544bd4c96b7907 100644 (file)
@@ -2328,8 +2328,6 @@ int check_config_validity()
                                           curproxy->id, bind_conf->arg, bind_conf->file, bind_conf->line, new_mask);
                        }
 
-                       bind_recount_thread_bits(bind_conf);
-
                        /* detect process and nbproc affinity inconsistencies */
                        mask = proc_mask(bind_conf->bind_proc) & proc_mask(curproxy->bind_proc);
                        if (!(mask & all_proc_mask)) {
index a7e72905ffc027bcc797b1ed09416b0857995614..a3fb743b85d0aa01c1aaeb52e893878a82d7e8ba 100644 (file)
@@ -1117,33 +1117,6 @@ void bind_dump_kws(char **out)
        }
 }
 
-/* recompute the bit counts per parity for the bind_thread value. This will be
- * used to quickly map a thread number from 1 to #thread to a thread ID among
- * the ones bound. This is the preparation phase of the bit rank counting algo
- * described here: https://graphics.stanford.edu/~seander/bithacks.html
- */
-void bind_recount_thread_bits(struct bind_conf *conf)
-{
-       unsigned long m;
-
-       m = thread_mask(conf->bind_thread);
-       conf->thr_count = my_popcountl(m);
-       mask_prep_rank_map(m, &conf->thr_2, &conf->thr_4, &conf->thr_8, &conf->thr_16);
-}
-
-/* Report the ID of thread <r> in bind_conf <conf> according to its thread_mask.
- * <r> must be between 0 and LONGBITS-1. This makes use of the pre-computed
- * bits resulting from bind_recount_thread_bits. See this function for more
- * info.
- */
-unsigned int bind_map_thread_id(const struct bind_conf *conf, unsigned int r)
-{
-       unsigned long m;
-
-       m = thread_mask(conf->bind_thread);
-       return mask_find_rank_bit_fast(r, m, conf->thr_2, conf->thr_4, conf->thr_8, conf->thr_16);
-}
-
 /************************************************************************/
 /*      All supported sample and ACL keywords must be declared here.    */
 /************************************************************************/
@@ -1354,7 +1327,6 @@ static int bind_parse_process(char **args, int cur_arg, struct proxy *px, struct
 
        conf->bind_proc |= proc;
        conf->bind_thread |= thread;
-       bind_recount_thread_bits(conf);
        return 0;
 }