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

Refactor Log Size Limit. #13476

Merged
merged 1 commit into from
May 24, 2022
Merged

Refactor Log Size Limit. #13476

merged 1 commit into from
May 24, 2022

Conversation

amotin
Copy link
Member

@amotin amotin commented May 18, 2022

Original Log Size Limit implementation (#12284) blocked all writes in case of limit reached until the TXG is committed and the log is freed. It caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles the writes on the log size, using exactly the same mechanism as used for dirty data.

How Has This Been Tested?

Without the patch repeating writes over a small chunk of ZVOL triggering the log size limit mechanism caused visible multi-second delays in traffic, as observed in #12868. With the patch on the same test write operation time measured by fio never goes above 1 ms.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@amotin amotin requested review from prakashsurya and behlendorf May 18, 2022 16:09
@amotin
Copy link
Member Author

amotin commented May 18, 2022

@jxdking Would you please take a look on this refactoring of your commit.

@amotin amotin added the Status: Code Review Needed Ready for review and testing label May 18, 2022
@amotin amotin mentioned this pull request May 18, 2022
13 tasks
Copy link
Contributor

@jxdking jxdking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good for me.

module/zfs/dmu_tx.c Outdated Show resolved Hide resolved
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels May 24, 2022
@behlendorf behlendorf merged commit 84d0a03 into openzfs:master May 24, 2022
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
nicman23 pushed a commit to nicman23/zfs that referenced this pull request Aug 22, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Sep 12, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
beren12 pushed a commit to beren12/zfs that referenced this pull request Sep 19, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
andrewc12 pushed a commit to andrewc12/openzfs that referenced this pull request Sep 23, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
ixhamza pushed a commit to truenas/zfs that referenced this pull request Sep 26, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
Signed-off-by: Ameer Hamza <[email protected]>
# Conflicts:
#	man/man4/zfs.4
tonyhutter pushed a commit to tonyhutter/zfs that referenced this pull request Sep 26, 2022
Original Log Size Limit implementation blocked all writes in case of
limit reached until the TXG is committed and the log is freed.  It
caused huge delays and following speed spikes in application writes.

This implementation instead smoothly throttles writes, using exactly
the same mechanism as used for dirty data.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: jxdking <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Sponsored-By: iXsystems, Inc.
Issue openzfs#12284
Closes openzfs#13476
bsdjhb pushed a commit to CTSRD-CHERI/zfs that referenced this pull request Jul 13, 2023
This is not associated with a specific upstream commit but apparently
a local diff applied as part of:

commit e3aa18ad71782a73d3dd9dd3d526bbd2b607ca16
Merge: 645886d028c8 b9d9845
Author: Martin Matuska <[email protected]>
Date:   Fri Jun 3 17:58:39 2022 +0200

    zfs: merge openzfs/zfs@b9d98453f

    Notable upstream pull request merges:
      openzfs#12321 Fix inflated quiesce time caused by lwb_tx during zil_commit()
      openzfs#13244 zstd early abort
      openzfs#13360 Verify BPs as part of spa_load_verify_cb()
      openzfs#13452 More speculative prefetcher improvements
      openzfs#13466 Expose zpool guids through kstats
      openzfs#13476 Refactor Log Size Limit
      openzfs#13484 FreeBSD: libspl: Add locking around statfs globals
      openzfs#13498 Cancel in-progress rebuilds when we finish removal
      openzfs#13499 zed: Take no action on scrub/resilver checksum errors
      openzfs#13513 Remove wrong assertion in log spacemap

    Obtained from:  OpenZFS
    OpenZFS commit: b9d9845
@amotin amotin deleted the wrlog branch October 9, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants