Skip to content
  • Jon Paul Maloy's avatar
    tipc: introduce starvation free send algorithm · 1f66d161
    Jon Paul Maloy authored
    
    
    Currently, we only use a single counter; the length of the backlog
    queue, to determine whether a message should be accepted to the queue
    or not. Each time a message is being sent, the queue length is compared
    to a threshold value for the message's importance priority. If the queue
    length is beyond this threshold, the message is rejected. This algorithm
    implies a risk of starvation of low importance senders during very high
    load, because it may take a long time before the backlog queue has
    decreased enough to accept a lower level message.
    
    We now eliminate this risk by introducing a counter for each importance
    priority. When a message is sent, we check only the queue level for that
    particular message's priority. If that is ok, the message can be added
    to the backlog, irrespective of the queue level for other priorities.
    This way, each level is guaranteed a certain portion of the total
    bandwidth, and any risk of starvation is eliminated.
    
    Reviewed-by: default avatarYing Xue <ying.xue@windriver.com>
    Reviewed-by: default avatarErik Hugne <erik.hugne@ericsson.com>
    Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1f66d161