• Lars Ellenberg's avatar
    drbd: add caching oldest request pointers for replication stages · 7753a4c1
    Lars Ellenberg authored
    A request that is to be shipped to the peer goes through a few stages:
    - queued
    - sent, waiting for ack
    - ack received, waiting for "barrier ack", which is re-order epoch being
      closed on the peer by acknowledging a "cache flush" equivalent
      on the lower level device.
    
    In the later two stages, depending on protocol, we may have already
    completed this request to the upper layers, so it won't be found anymore
    on device->pending_master_completion[] lists.
    
    Track the oldest request yet to be sent (req_next), the oldest not yet
    acknowledged (req_ack_pending) and the oldest "still waiting for
    something from the peer" (req_not_net_done), doing short list walks on
    the transfer log to find the next pending one whenever such a request
    makes progress.
    
    Now we have a fast way to look up the oldest requests,
    don't do a transfer log walk every time.
    Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
    Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
    7753a4c1
drbd_req.c 50.3 KB