linux_dsm_epyc7002/net/tipc
Jon Paul Maloy 365ad353c2 tipc: reduce risk of user starvation during link congestion
The socket code currently handles link congestion by either blocking
and trying to send again when the congestion has abated, or just
returning to the user with -EAGAIN and let him re-try later.

This mechanism is prone to starvation, because the wakeup algorithm is
non-atomic. During the time the link issues a wakeup signal, until the
socket wakes up and re-attempts sending, other senders may have come
in between and occupied the free buffer space in the link. This in turn
may lead to a socket having to make many send attempts before it is
successful. In extremely loaded systems we have observed latency times
of several seconds before a low-priority socket is able to send out a
message.

In this commit, we simplify this mechanism and reduce the risk of the
described scenario happening. When a message is attempted sent via a
congested link, we now let it be added to the link's backlog queue
anyway, thus permitting an oversubscription of one message per source
socket. We still create a wakeup item and return an error code, hence
instructing the sender to block or stop sending. Only when enough space
has been freed up in the link's backlog queue do we issue a wakeup event
that allows the sender to continue with the next message, if any.

The fact that a socket now can consider a message sent even when the
link returns a congestion code means that the sending socket code can
be simplified. Also, since this is a good opportunity to get rid of the
obsolete 'mtu change' condition in the three socket send functions, we
now choose to refactor those functions completely.

Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-03 11:13:05 -05:00
..
addr.c
addr.h
bcast.c tipc: reduce risk of user starvation during link congestion 2017-01-03 11:13:05 -05:00
bcast.h tipc: fix broadcast link synchronization problem 2016-10-29 17:21:09 -04:00
bearer.c tipc: check minimum bearer MTU 2016-12-02 14:03:20 -05:00
bearer.h tipc: check minimum bearer MTU 2016-12-02 14:03:20 -05:00
core.c netns: make struct pernet_operations::id unsigned int 2016-11-18 10:59:15 -05:00
core.h netns: make struct pernet_operations::id unsigned int 2016-11-18 10:59:15 -05:00
discover.c
discover.h
eth_media.c
ib_media.c
Kconfig
link.c tipc: reduce risk of user starvation during link congestion 2017-01-03 11:13:05 -05:00
link.h
Makefile
monitor.c tipc: improve sanity check for received domain records 2016-11-25 20:06:18 -05:00
monitor.h
msg.c [iov_iter] new primitives - copy_from_iter_full() and friends 2016-12-05 14:33:36 -05:00
msg.h tipc: reduce risk of user starvation during link congestion 2017-01-03 11:13:05 -05:00
name_distr.c tipc: fix broadcast link synchronization problem 2016-10-29 17:21:09 -04:00
name_distr.h
name_table.c tipc: modify struct tipc_plist to be more versatile 2017-01-03 11:13:05 -05:00
name_table.h tipc: modify struct tipc_plist to be more versatile 2017-01-03 11:13:05 -05:00
net.c
net.h
netlink_compat.c genetlink: mark families as __ro_after_init 2016-10-27 16:16:09 -04:00
netlink.c genetlink: mark families as __ro_after_init 2016-10-27 16:16:09 -04:00
netlink.h
node.c tipc: reduce risk of user starvation during link congestion 2017-01-03 11:13:05 -05:00
node.h
server.c
server.h
socket.c tipc: reduce risk of user starvation during link congestion 2017-01-03 11:13:05 -05:00
socket.h
subscr.c
subscr.h
sysctl.c
udp_media.c tipc: check minimum bearer MTU 2016-12-02 14:03:20 -05:00
udp_media.h