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

Introduce dsl_dir_diduse_transfer_space(). #12300

Merged
merged 1 commit into from Jul 16, 2021
Merged

Commits on Jun 30, 2021

  1. Introduce dsl_dir_diduse_transfer_space().

    Most of dsl_dir_diduse_space() and dsl_dir_transfer_space() CPU time
    is a dd_lock overhead and time spent in dmu_buf_will_dirty(). Calling
    them one after another is a waste of time and even more contention.
    Doing that twice for each rewritten block within dbuf_write_done()
    via dsl_dataset_block_kill() and dsl_dataset_block_born() created one
    of the biggest CPU overheads in case of small blocks rewrite.
    
    dsl_dir_diduse_transfer_space() combines functionality of these two
    functions for cases where it is needed, but without double overhead,
    practically for the cost of dsl_dir_diduse_space() or even cheaper.
    
    While there, optimize dsl_dir_phys() calls in dsl_dir_diduse_space()
    and dsl_dir_transfer_space().  It seems Clang detects some aliasing
    there, repeating dd->dd_dbuf->db_data dereference multiple times,
    increasing dd_lock scope and contention.
    
    Signed-off-by: Alexander Motin <mav@FreeBSD.org>
    Sponsored-By: iXsystems, Inc.
    amotin committed Jun 30, 2021
    Copy the full SHA
    ad104fc View commit details
    Browse the repository at this point in the history