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

Several sorted scrub optimizations. #13576

Merged
merged 1 commit into from
Jun 24, 2022
Merged

Several sorted scrub optimizations. #13576

merged 1 commit into from
Jun 24, 2022

Commits on Jun 22, 2022

  1. Several sorted scrub optimizations.

     - Reduce size and comparison complexity of q_exts_by_size B-tree.
    Previous code used two 64-bit divisions and many other operations to
    compare two B-tree elements.  It created enormous overhead.  This
    implementation moves the math to the upper level and stores the score
    in the B-tree elements themselves.  Since all that we need to store in
    that B-tree is the extent score and offset, those can fit into single
    8 byte value instead of 24 bytes of q_exts_by_addr element and can be
    compared with single operation.
     - Better decouple secondary tree logic from main range_tree by moving
    rt_btree_ops and related functions into dsl_scan.c as ext_size_ops.
    Those functions are very small to worry about the code duplication and
    range_tree does not need to know details such as rt_btree_compare.
     - Instead of accounting number of pending bytes per pool, that needs
    atomic on global variable per block, account the number of non-empty
    per-vdev queues, that change much more rarely.
     - When extent scan is interrupted by TXG end, continue it in the next
    TXG instead of selecting next best extent.  It allows to avoid leaving
    one truncated (and so likely not the best any more) extent each TXG.
    
    On top of some other optimizations this saves about 1.5 minutes out of
    10 to scrub pool of 12 SSDs, storing 1.5TB of 4KB zvol blocks.
    
    Signed-off-by: Alexander Motin <mav@FreeBSD.org>
    Sponsored-By: iXsystems, Inc.
    amotin committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    e027903 View commit details
    Browse the repository at this point in the history