haproxy/include/proto
Willy Tarreau 037d2c1f8f MAJOR: sepoll: make the poller totally event-driven
At the moment sepoll is not 100% event-driven, because a call to fd_set()
on an event which is already being polled will not change its state.

This causes issues with OpenSSL because if some I/O processing is interrupted
after clearing the I/O event (eg: read all data from a socket, can't put it
all into the buffer), then there is no way to call the SSL_read() again once
the buffer releases some space.

The only real solution is to go 100% event-driven. The principle is to use
the spec list as an event cache and that each time an I/O event is reported
by epoll_wait(), this event is automatically scheduled for addition to the
spec list for future calls until the consumer explicitly asks for polling
or stopping.

Doing this is a bit tricky because sepoll used to provide a substantial
number of optimizations such as event merging. These optimizations have
been maintained : a dedicated update list is affected when events change,
but not the event list, so that updates may cancel themselves without any
side effect such as displacing events. A specific case was considered for
handling newly created FDs as soon as they are detected from within the
poll loop. This ensures that their read or write operation will always be
attempted as soon as possible, thus reducing the number of poll loops and
process_session wakeups. This is especially true for newly accepted fds
which immediately perform their first recv() call.

Two new flags were added to the fdtab[] struct to tag the fact that a file
descriptor already exists in the update list. One flag indicates that a
file descriptor is new and has just been created (fdtab[].new) and the other
one indicates that a file descriptor is already referenced by the update list
(fdtab[].updated). Even if the FD state changes during operations or if the
fd is closed and replaced, it's not an issue because the update flag remains
and is easily spotted during list walks. The flag must absolutely reflect the
presence of the fd in the update list in order to avoid overflowing the update
list with more events than there are distinct fds.

Note that this change also recovers the small performance loss introduced
by its connection counter-part and goes even beyond.
2012-11-10 00:17:27 +01:00
..
acl.h MINOR: acl: add parse and match primitives to use binary type on ACLs 2012-10-22 18:54:24 +02:00
arg.h MEDIUM: sample: pass an empty list instead of a null for fetch args 2012-10-19 19:49:09 +02:00
auth.h MAJOR: acl: make use of the new sample struct and get rid of acl_test 2012-05-08 20:57:14 +02:00
backend.h REORG/MAJOR: use "struct channel" instead of "struct buffer" 2012-09-02 21:54:55 +02:00
channel.h OPTIM: channel: inline channel_forward's fast path 2012-10-26 01:08:01 +02:00
checks.h CLEANUP: Make check_statuses, analyze_statuses and process_chk static 2012-03-24 21:54:19 +01:00
compression.h CLEANUP: use struct comp_ctx instead of union 2012-11-05 10:23:16 +01:00
connection.h MAJOR: connection: remove the CO_FL_CURR_*_POL flag 2012-11-09 22:09:33 +01:00
cttproxy.h [MEDIUM] check for cttproxy support when required 2007-03-24 17:24:39 +01:00
dumpstats.h REORG: buffers: split buffers into chunk,buffer,channel 2012-09-03 20:47:32 +02:00
fd.h MAJOR: sepoll: make the poller totally event-driven 2012-11-10 00:17:27 +01:00
freq_ctr.h [MINOR] freq_ctr: add new types and functions for periods different from 1s 2010-08-10 14:01:09 +02:00
frontend.h REORG: connection: move the PROXY protocol management to connection.c 2012-10-05 00:32:33 +02:00
hdr_idx.h OPTIM/MINOR: move the hdr_idx pools out of the proxy struct 2011-10-24 18:15:04 +02:00
lb_chash.h [MEDIUM] backend: implement consistent hashing variation 2009-10-09 07:17:58 +02:00
lb_fas.h MEDIUM: backend: add the 'first' balancing algorithm 2012-02-21 22:27:27 +01:00
lb_fwlc.h [CLEANUP] backend: move LB algos to individual files 2009-10-01 11:19:37 +02:00
lb_fwrr.h [CLEANUP] backend: move LB algos to individual files 2009-10-01 11:19:37 +02:00
lb_map.h [MINOR] lb_map: reorder code in order to ease integration of new hash functions 2009-10-01 21:11:15 +02:00
listener.h REORG: listener: move unix perms from the listener to the bind_conf 2012-09-20 18:07:14 +02:00
log.h MINOR: log: make lf_text use a const char * 2012-10-12 20:30:51 +02:00
peers.h [CLEANUP] peers.h: fix declarations 2011-06-18 20:27:19 +02:00
pipe.h [MEDIUM] introduce pipe pools 2009-01-25 13:49:53 +01:00
port_range.h [MEDIUM] add support for binding to source port ranges during connect 2009-06-10 12:23:32 +02:00
proto_http.h MEDIUM: remove remains of BUFSIZE in HTTP auth and sample conversions 2012-10-29 20:44:36 +01:00
proto_tcp.h MEDIUM: stick-table: allocate the table key of size buffer size 2012-10-29 21:56:59 +01:00
proto_uxst.h BUG/MEDIUM: stream_interface: restore get_src/get_dst 2012-05-11 16:48:10 +02:00
protocol.h REORG: split "protocols" files into protocol and listener 2012-09-15 22:29:32 +02:00
proxy.h REORG: split "protocols" files into protocol and listener 2012-09-15 22:29:32 +02:00
queue.h BUG/MEDIUM: zero-weight servers must not dequeue requests from the backend 2012-01-20 16:18:53 +01:00
raw_sock.h REORG: connection: rename the data layer the "transport layer" 2012-10-04 22:26:09 +02:00
sample.h MEDIUM: remove remains of BUFSIZE in HTTP auth and sample conversions 2012-10-29 20:44:36 +01:00
server.h MINOR: server: add minimal infrastructure to parse keywords 2012-10-10 17:42:39 +02:00
session.h CLEANUP: session: remove term_trace which is not used anymore 2012-10-13 11:10:30 +02:00
shctx.h MINOR: ssl: add build param USE_PRIVATE_CACHE to build cache without shared memory 2012-10-02 08:34:38 +02:00
signal.h CLEANUP: includes: fix includes for a number of users of fd.h 2012-09-03 20:49:14 +02:00
ssl_sock.h MEDIUM: log: report SSL ciphers and version in logs using logformat %sslc/%sslv 2012-10-12 20:48:51 +02:00
stick_table.h MEDIUM: stick-table: allocate the table key of size buffer size 2012-10-29 21:56:59 +01:00
stream_interface.h MAJOR: session: detach the connections from the stream interfaces 2012-10-26 20:15:20 +02:00
task.h [MAJOR] proxy: finally get rid of maintain_proxies() 2011-07-25 16:33:49 +02:00
template.h [CLEANUP] included common/version.h everywhere 2006-06-29 18:54:54 +02:00