]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: reduce risk of wakeup queue starvation
authorJon Maloy <jon.maloy@ericsson.com>
Tue, 30 Jul 2019 14:23:18 +0000 (16:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Aug 2019 22:19:28 +0000 (18:19 -0400)
commit92375125d6084aacf148b125113bc0c556766442
tree80c6d8b40074cc4914a89db971a7324274adb1ac
parent6c076a76242b79b0addd9d5f53cb28d1b1e36610
tipc: reduce risk of wakeup queue starvation

In commit 82fb1fad8c3b ("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: 82fb1fa ("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>
net/tipc/link.c