haproxy/src
Willy Tarreau 3ef7a190b0 MEDIUM: tasks: apply a fair CPU distribution between tasklet classes
Till now in process_runnable_tasks() we used to reserve a fixed portion
of max_processed to urgent tasks, then a portion of what remains for
normal tasks, then what remains for bulk tasks. This causes two issues:

  - the current budget for processed tasks could be drained once for
    all by higher level tasks so that they couldn't have enough left
    for the next run. For example, if bulk tasklets cause task wakeups,
    the required share to run them could be eaten by other bulk tasklets.

  - it forces the urgent tasks to be run before scanning the tree so that
    we know how many tasks to pick from the tree, and this isn't very
    efficient cache-wise.

This patch changes this so that we compute upfront how max_processed will
be shared between classes that require so. We can then decide in advance
to pick a certain number of tasks from the tree, then execute all tasklets
in turn. When reaching the end, if there's still some budget, we can go
back and do the same thing again, improving chances to pick new work
before the global budget is depleted.

The default weights have been set to 50% for urgent tasklets, 37% for
normal ones and 13% for the bulk ones. In practice, there are not that
many urgent tasklets but when they appear they are cheap and must be
processed in as large batches as possible. Every time there is nothing
to pick there, the unused budget is shared between normal and bulk and
this allows bulk tasklets to still have quite some CPU to run on.
2020-06-24 12:21:26 +02:00
..
51d.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
acl.c BUILD: Re-enable -Wimplicit-fallthrough 2020-06-11 16:49:37 +02:00
action.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
activity.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
applet.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
arg.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
auth.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
backend.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
base64.c REORG: include: move base64.h, errors.h and hash.h from common to to haproxy/ 2020-06-11 10:18:56 +02:00
buffer.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
cache.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
calltrace.c REORG: include: move time.h from common/ to haproxy/ 2020-06-11 10:18:56 +02:00
cfgparse-global.c MEDIUM: peers: add the "localpeer" global option 2020-06-19 11:37:30 +02:00
cfgparse-listen.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
cfgparse-ssl.c REORG: include: move cfgparse.h to haproxy/cfgparse.h 2020-06-11 10:18:58 +02:00
cfgparse.c BUG/MINOR: cfgparse: Fix calculation of position for PARSE_ERR_TOOMANY message 2020-06-23 19:03:20 +02:00
channel.c REORG: include: move channel.h to haproxy/channel{,-t}.h 2020-06-11 10:18:58 +02:00
check.c BUG/MEDIUM: checks: Fix off-by-one in allocation of SMTP greeting cmd 2020-06-12 16:18:02 +02:00
chunk.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
cli.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
compression.c BUILD: compression: make gcc 10 happy with free_zlib() 2020-06-14 08:00:19 +02:00
connection.c BUG/MAJOR: connection: always disable ready events once reported 2020-06-17 17:00:51 +02:00
da.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
debug.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
dgram.c REORG: dgram: rename proto_udp to dgram 2020-06-11 10:18:59 +02:00
dict.c REORG: include: move THREAD_LOCAL and __decl_thread() to compiler.h 2020-06-11 10:18:59 +02:00
dns.c REORG: dgram: rename proto_udp to dgram 2020-06-11 10:18:59 +02:00
eb32sctree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
eb32tree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
eb64tree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebimtree.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
ebistree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebmbtree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebpttree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebsttree.c REORG: ebtree: move the include files from ebtree to include/import/ 2020-06-11 09:31:11 +02:00
ebtree.c BUG/MEDIUM: ebtree: use a byte-per-byte memcmp() to compare memory blocks 2020-06-16 11:30:33 +02:00
ev_epoll.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
ev_evports.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
ev_kqueue.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
ev_poll.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
ev_select.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
extcheck.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
fcgi-app.c BUG/MEDIUM: fcgi-app: Resolve the sink if a fcgi-app logs in a ring buffer 2020-06-22 11:35:55 +02:00
fcgi.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
fd.c MINOR: debug: add a new DEBUG_FD build option 2020-06-23 10:04:54 +02:00
filters.c REORG: include: move cfgparse.h to haproxy/cfgparse.h 2020-06-11 10:18:58 +02:00
flt_http_comp.c REORG: include: move cfgparse.h to haproxy/cfgparse.h 2020-06-11 10:18:58 +02:00
flt_spoe.c BUG/MINOR: spoe: correction of setting bits for analyzer 2020-06-22 11:52:04 +02:00
flt_trace.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
freq_ctr.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
frontend.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
h1.c REORG: include: move channel.h to haproxy/channel{,-t}.h 2020-06-11 10:18:58 +02:00
h1_htx.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
h2.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
haproxy.c MINOR: ssl: move the ckch/crtlist deinit to ssl_sock.c 2020-06-24 09:57:18 +02:00
hash.c REORG: include: move base64.h, errors.h and hash.h from common to to haproxy/ 2020-06-11 10:18:56 +02:00
hlua.c BUILD: Re-enable -Wimplicit-fallthrough 2020-06-11 16:49:37 +02:00
hlua_fcn.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
hpack-dec.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
hpack-enc.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
hpack-huff.c REORG: include: move hpack*.h to haproxy/ and split hpack-tbl 2020-06-11 10:18:57 +02:00
hpack-tbl.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
http.c MINOR: http: do not close connections anymore after internal responses 2020-06-16 17:41:32 +02:00
http_acl.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
http_act.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
http_ana.c BUG/MINOR: http_ana: clarify connection pointer check on L7 retry 2020-06-23 05:58:20 +02:00
http_conv.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
http_fetch.c BUG/MINOR: http: make smp_fetch_body() report that the contents may change 2020-06-15 18:16:19 +02:00
http_htx.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
http_rules.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
htx.c REORG: include: split common/htx.h into haproxy/htx{,-t}.h 2020-06-11 10:18:57 +02:00
lb_chash.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
lb_fas.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
lb_fwlc.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
lb_fwrr.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
lb_map.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
listener.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
log.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
lru.c MINOR: lru: new function to delete <nb> least recently used keys 2016-01-11 07:31:35 +01:00
mailers.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
map.c MEDIUM: map: make the "clear map" operation yield 2020-06-19 16:57:51 +02:00
mux_fcgi.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
mux_h1.c MINOR: mux_h1: Set H1_F_CO_MSG_MORE if we know we have more to send. 2020-06-19 17:42:42 +02:00
mux_h2.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
mux_pt.c REORG: include: move stream.h to haproxy/stream{,-t}.h 2020-06-11 10:18:58 +02:00
mworker-prog.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
mworker.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
namespace.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
pattern.c MEDIUM: map: make the "clear map" operation yield 2020-06-19 16:57:51 +02:00
payload.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
peers.c BUILD: Re-enable -Wimplicit-fallthrough 2020-06-11 16:49:37 +02:00
pipe.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
pool.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
proto_sockpair.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
proto_tcp.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
proto_uxst.c BUILD: proto_uxst: shut up yet another gcc's absurd warning 2020-06-12 16:15:44 +02:00
protocol.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
proxy.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
queue.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
raw_sock.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
regex.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
ring.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
sample.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
server.c BUILD: include: add sys/types before netinet/tcp.h 2020-06-11 11:22:44 +02:00
session.c REORG: include: move stream.h to haproxy/stream{,-t}.h 2020-06-11 10:18:58 +02:00
sha1.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
shctx.c REORG: include: split global.h into haproxy/global{,-t}.h 2020-06-11 10:18:58 +02:00
signal.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
sink.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
ssl_ckch.c MINOR: ssl: free the crtlist and the ckch during the deinit() 2020-06-23 20:07:50 +02:00
ssl_crtlist.c BUG/MINOR: ssl/cli: certs added from the CLI can't be deleted 2020-06-24 01:00:52 +02:00
ssl_sample.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
ssl_sock.c MINOR: ssl: move the ckch/crtlist deinit to ssl_sock.c 2020-06-24 09:57:18 +02:00
ssl_utils.c REORG: include: move ssl_sock.h to haproxy/ssl_sock{,-t}.h 2020-06-11 10:18:58 +02:00
stats.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
stick_table.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
stream.c MINOR: activity: rename the "stream" field to "stream_calls" 2020-06-17 20:52:29 +02:00
stream_interface.c BUG/MEDIUM: stream-int: fix loss of CO_SFL_MSG_MORE flag in forwarding 2020-06-19 17:42:42 +02:00
task.c MEDIUM: tasks: apply a fair CPU distribution between tasklet classes 2020-06-24 12:21:26 +02:00
tcp_rules.c BUG/MINOR: tcp-rules: tcp-response must check the buffer's fullness 2020-06-15 18:16:20 +02:00
tcpcheck.c BUILD: Re-enable -Wimplicit-fallthrough 2020-06-11 16:49:37 +02:00
thread.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
time.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
tools.c MINOR: tools: add a new configurable line parse, parse_line() 2020-06-16 16:27:26 +02:00
trace.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
uri_auth.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
vars.c BUG/MAJOR: vars: Fix bogus free() during deinit() for http-request rules 2020-06-15 18:51:11 +02:00
version.c BUILD: Fix build by including haproxy/global.h 2020-06-16 23:36:04 +02:00
wdt.c REORG: include: move the error reporting functions to from log.h to errors.h 2020-06-11 10:18:59 +02:00
wurfl.c CLEANUP: include: tree-wide alphabetical sort of include files 2020-06-11 10:18:59 +02:00
xprt_handshake.c REORG: include: move stream_interface.h to haproxy/stream_interface{,-t}.h 2020-06-11 10:18:58 +02:00
xxhash.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00