kernel-fxtec-pro1x/net/tipc
Jon Maloy 523834b0ac tipc: reduce risk of wakeup queue starvation
[ Upstream commit 7c5b42055964f587e55bd87ef334c3a27e95d144 ]

In commit 365ad353c2 ("tipc: reduce risk of user starvation during
link congestion") we allowed senders to add exactly one list of extra
buffers to the link backlog queues during link congestion (aka
"oversubscription"). However, the criteria for when to stop adding
wakeup messages to the input queue when the overload abates is
inaccurate, and may cause starvation problems during very high load.

Currently, we stop adding wakeup messages after 10 total failed attempts
where we find that there is no space left in the backlog queue for a
certain importance level. The counter for this is accumulated across all
levels, which may lead the algorithm to leave the loop prematurely,
although there may still be plenty of space available at some levels.
The result is sometimes that messages near the wakeup queue tail are not
added to the input queue as they should be.

We now introduce a more exact algorithm, where we keep adding wakeup
messages to a level as long as the backlog queue has free slots for
the corresponding level, and stop at the moment there are no more such
slots or when there are no more wakeup messages to dequeue.

Fixes: 365ad35 ("tipc: reduce risk of user starvation during link congestion")
Reported-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:51:02 +01:00
..
addr.c tipc: initialise addr_trail_end when setting node addresses 2019-08-25 10:48:05 +02:00
addr.h
bcast.c
bcast.h
bearer.c
bearer.h
core.c tipc: fix ordering of tipc module init and exit routine 2019-12-21 10:57:16 +01:00
core.h
diag.c
discover.c
discover.h
eth_media.c
group.c
group.h
ib_media.c
Kconfig
link.c tipc: reduce risk of wakeup queue starvation 2020-01-27 14:51:02 +01:00
link.h
Makefile
monitor.c tipc: update mon's self addr when node addr generated 2020-01-27 14:49:52 +01:00
monitor.h tipc: update mon's self addr when node addr generated 2020-01-27 14:49:52 +01:00
msg.c tipc: fix unlimited bundling of small messages 2019-10-07 18:57:25 +02:00
msg.h
name_distr.c tipc: eliminate message disordering during binding table update 2020-01-27 14:50:00 +01:00
name_distr.h
name_table.c tipc: eliminate message disordering during binding table update 2020-01-27 14:50:00 +01:00
name_table.h tipc: eliminate message disordering during binding table update 2020-01-27 14:50:00 +01:00
net.c tipc: update mon's self addr when node addr generated 2020-01-27 14:49:52 +01:00
net.h
netlink.c
netlink.h
netlink_compat.c tipc: fix link name length check 2019-12-05 09:21:31 +01:00
node.c tipc: tipc clang warning 2020-01-27 14:50:33 +01:00
node.h
socket.c tipc: fix wrong timeout input for tipc_wait_for_cond() 2020-01-27 14:49:52 +01:00
socket.h
subscr.c
subscr.h
sysctl.c tipc: set sysctl_tipc_rmem and named_timeout right range 2020-01-27 14:50:39 +01:00
topsrv.c
topsrv.h
udp_media.c
udp_media.h