• Lars Ellenberg's avatar
    drbd: always implicitly close last epoch when idle · f9c78128
    Lars Ellenberg authored
    Once our sender thread needs to wait_for_work(),
    and actually needs to schedule(), just before we do that,
    we already check if it is useful to implicitly close the last epoch.
    
    The condition was too strict: only implicitly close the epoch,
    if there have been no new (write) requests at all.
    
    The assumption was that if there were new requests, they would
    always be communicated one way or another, and would send necessary
    epoch separating barriers explicitly.
    
    This is not always true, e.g. when becoming diskless,
    or while explicitly starting a full resync.
    
    The last communicated epoch could stay open for a long time,
    locking down corresponding activity log extents.
    
    It is safe to always implicitly send that last barrier, as soon as we
    determin that there cannot be more requests in the last communicated
    epoch, even if there have been (uncommunicated) new requests in new
    epochs meanwhile.
    Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
    Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    f9c78128
drbd_worker.c 56.8 KB