• Andrey Vagin's avatar
    tcp: restore the boundary between sent and unsent data · 98efb3c9
    Andrey Vagin authored
    All data in a write buffer can be divided on two parts sent but not yet
    acknowledged data and unsent data.
    
    Currently the boundary between sent and unsent data is not dumped and
    all the data are restored as if they have already been sent.
    This methode can provoke long delays in tcp connection, because a kernel
    can wait before retransmitting data.
    https://bugzilla.openvz.org/show_bug.cgi?id=2808
    
    The TCP stack must know which data have been sent, because
    acknowledgment can be received for them. These data must be restored in
    repair mode.
    
    The second part of data have never been sent out, so they can be
    restored without any tricks. These data can be sent into socket as
    usual.
    
    For restoring unsent data the repair mode is disabled for socket,
    but it is enabled back after restoring data. It will be disabled
    after unlocking network. In this case window probe is sent, which is
    required for waknge the connection.
    
    This patch fixes long delays in tcp connections after dumping and
    restoring.
    
    Thanks Pavel for the idea of disabling repair mode for restoring
    unsent data.
    
    https://bugzilla.openvz.org/show_bug.cgi?id=2808Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    98efb3c9
sk-tcp.c 14.3 KB