• Dave Chinner's avatar
    xfs: log ticket region debug is largely useless · c5141320
    Dave Chinner authored
    xlog_tic_add_region() is used to trace the regions being added to a
    log ticket to provide information in the situation where a ticket
    reservation overrun occurs. The information gathered is stored int
    the ticket, and dumped if xlog_print_tic_res() is called.
    
    For a front end struct xfs_trans overrun, the ticket only contains
    reservation tracking information - the ticket is never handed to the
    log so has no regions attached to it. The overrun debug information in this
    case comes from xlog_print_trans(), which walks the items attached
    to the transaction and dumps their attached formatted log vectors
    directly. It also dumps the ticket state, but that only contains
    reservation accounting and nothing else. Hence xlog_print_tic_res()
    never dumps region or overrun information from this path.
    
    xlog_tic_add_region() is actually called from xlog_write(), which
    means it is being used to track the regions seen in a
    CIL checkpoint log vector chain. In looking at CIL behaviour
    recently, I've seen 32MB checkpoints regularly exceed 250,000 
    regions in the LV chain. The log ticket debug code can track *15*
    regions. IOWs, if there is a ticket overrun in the CIL code, the
    ticket region tracking code is going to be completely useless for
    determining what went wrong. The only thing it can tell us is how
    much of an overrun occurred, and we really don't need extra debug
    information in the log ticket to tell us that.
    
    Indeed, the main place we call xlog_tic_add_region() is also adding
    up the number of regions and the space used so that xlog_write()
    knows how much will be written to the log. This is exactly the same
    information that log ticket is storing once we take away the useless
    region tracking array. Hence xlog_tic_add_region() is not useful,
    but can be called 250,000 times a CIL push...
    
    Just strip all that debug "information" out of the of the log ticket
    and only have it report reservation space information when an
    overrun occurs. This also reduces the size of a log ticket down by
    about 150 bytes...
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChandan Babu R <chandan.babu@oracle.com>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    c5141320
xfs_log.c 109 KB