Skip to content
  • Dave Chinner's avatar
    xfs: don't do memory allocation under the CIL context lock · 3b93c7aa
    Dave Chinner authored
    
    
    Formatting items requires memory allocation when using delayed
    logging. Currently that memory allocation is done while holding the
    CIL context lock in read mode. This means that if memory allocation
    takes some time (e.g. enters reclaim), we cannot push on the CIL
    until the allocation(s) required by formatting complete. This can
    stall CIL pushes for some time, and once a push is stalled so are
    all new transaction commits.
    
    Fix this splitting the item formatting into two steps. The first
    step which does the allocation and memcpy() into the allocated
    buffer is now done outside the CIL context lock, and only the CIL
    insert is done inside the CIL context lock. This avoids the stall
    issue.
    
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    3b93c7aa