haproxy/include/import
Willy Tarreau 253fba01a7 IMPORT: plock: lower the slope of the exponential back-off
Along many tests involving both haproxy's scheduler and forwarded
traffic, various exponents and algorithms were attempted for the EBO
and their effects were measured. It was found that a growth in 1.25^N
limited to 128k cycles consistently gives a better latency than 1.5^N
limited to 256k cycles, without degrading general performance. The
measures of the time to grab a write lock on a 48-thread EPYC show
that the number of occurrences of low times was roughly multiplied by
2-3 while the number of occurrences of times above 64us was reduced
by similar factors, to even reach 300 at 64us and limiting the maximum
time by a factor of 4.

The other variants that were experimented with are:

  m = ((m + (m >> 1)) + 2) & 0x3ffff;            // original
  m = ((m + (m >> 1) + (m >> 3)) + 2) & 0x3ffff;
  m = ((m + (m >> 1) + (m >> 4)) + 2) & 0x3ffff;
  m = ((m + (m >> 1) + (m >> 4)) + 2) & 0x1ffff;
  m = ((m + (m >> 1) + (m >> 4)) + 1) & 0x1ffff;
  m = ((m + (m >> 2) + (m >> 4)) + 1) & 0x1ffff; // lowest CPU on pl_wr test + good perf
  m = ((m + (m >> 2)) + 1) & 0x1ffff;            // even lower cpu usage, lowest max
  m = ((m + (m >> 1) + (m >> 2)) + 1) & 0x1ffff; // correct but slightly higher maxes
  m = ((m + (m >> 1) + (m >> 3)) + 1) & 0x1ffff; // less good than m+m>>2
  m = ((m + (m >> 2) + (m >> 3)) + 1) & 0x1ffff; // better but not as good as m+m>>2
  m = ((m + (m >> 3) + (m >> 4)) + 1) & 0x1ffff; // less good, lower rates on small coounts.
  m = ((m + (m >> 2) + (m >> 3) + (m >> 4)) + 1) & 0x1ffff; // less good as well
  m = ((m & 0x7fff) + (m >> 1) + (m >> 4)) + 2;
  m = ((m & 0xffff) + (m >> 1) + (m >> 4)) + 2;

This is plock commit dddd9ee01c522da33c353e2e4d4fd743d8336ec3.
2025-02-07 18:04:29 +01:00
..
atomic-ops.h MAJOR: threads/plock: update the embedded library again 2023-08-11 19:03:35 +02:00
cebtree-prv.h BUILD: cebtree: silence a bogus gcc warning on impossible code paths 2024-09-18 17:42:52 +02:00
cebtree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebu32_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebu64_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebua_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebub_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebuib_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebuis_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebul_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
cebus_tree.h IMPORT: import cebtree (compact elastic binary trees) 2024-09-15 23:44:59 +02:00
eb32sctree.h REORG: ebtree: split structures into their own file ebtree-t.h 2021-10-07 01:41:14 +02:00
eb32tree.h REORG: ebtree: split structures into their own file ebtree-t.h 2021-10-07 01:41:14 +02:00
eb64tree.h REORG: ebtree: split structures into their own file ebtree-t.h 2021-10-07 01:41:14 +02:00
ebimtree.h BUG/MEDIUM: ebtree: use a byte-per-byte memcmp() to compare memory blocks 2020-06-16 11:30:33 +02:00
ebistree.h CLEANUP: assorted typo fixes in the code and comments 2024-09-03 17:49:21 +02:00
ebmbtree.h OPTIM: ebtree: make ebmb_insert_prefix() keep a copy the new node's key 2022-11-15 09:37:09 +01:00
ebpttree.h REORG: ebtree: split structures into their own file ebtree-t.h 2021-10-07 01:41:14 +02:00
ebsttree.h CLEANUP: assorted typo fixes in the code and comments 2024-09-03 17:49:21 +02:00
ebtree-t.h REORG: ebtree: split structures into their own file ebtree-t.h 2021-10-07 01:41:14 +02:00
ebtree.h IMPORT: ebtree: make string_equal_bits() return an unsigned 2024-01-06 13:35:42 +01:00
ist.h MINOR: ist: define iststrip() new function 2024-04-26 11:29:25 +02:00
lru.h REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
mjson.h MINOR: sample: converter: Add mjson library. 2021-04-15 17:05:38 +02:00
mt_list.h BUILD: import/mt_list: support building with TCC 2024-11-05 15:43:17 +01:00
plock.h IMPORT: plock: lower the slope of the exponential back-off 2025-02-07 18:04:29 +01:00
sha1.h IMPORT: sha1: import SHA1 functions 2017-10-25 04:45:48 +02:00
slz-tables.h BUILD: tree-wide: fix a few missing includes in a few files 2024-03-05 11:50:34 +01:00
slz.h IMPORT: slz: implement a synchronous flush() operation 2023-06-30 16:12:36 +02:00
xxhash.h BUILD: xxhash: silence a build warning on Solaris + gcc-5.5 2024-04-17 09:43:32 +02:00