Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZIL: Second attempt to reduce scope of zl_issuer_lock. #15122

Merged
merged 1 commit into from
Aug 25, 2023

Commits on Aug 24, 2023

  1. ZIL: Second attempt to reduce scope of zl_issuer_lock.

    The previous patch openzfs#14841 appeared to have significant flaw, causing
    deadlocks if zl_get_data callback got blocked waiting for TXG sync.  I
    already handled some of such cases in the original patch, but issue
     openzfs#14982 shown cases that were impossible to solve in that design.
    
    This patch fixes the problem by postponing log blocks allocation till
    the very end, just before the zios issue, leaving nothing blocking after
    that point to cause deadlocks.  Before that point though any sleeps are
    now allowed, not causing sync thread blockage.  This require slightly
    more complicated lwb state machine to allocate blocks and issue zios
    in proper order.  But with removal of special early issue workarounds
    the new code is much cleaner now, and should even be more efficient.
    
    Since this patch uses null zios between write, I've found that null
    zios do not wait for logical children ready status in zio_ready(),
    that makes parent write to proceed prematurely, producing incorrect
    log blocks.  Added ZIO_CHILD_LOGICAL_BIT to zio_wait_for_children()
    fixes it.
    
    Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
    Sponsored by:	iXsystems, Inc.
    amotin committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    9ddbff4 View commit details
    Browse the repository at this point in the history