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

L2ARC: Relax locking during write #16040

Merged
merged 1 commit into from
Apr 9, 2024
Merged

Commits on Mar 29, 2024

  1. L2ARC: Relax locking during write

    Previous code held ARC state sublist lock throughout all L2ARC
    write process, which included number of allocations and even ZIO
    issues.  Being blocked in any of those places the code could also
    block ARC eviction, that could cause OOM activation or even dead-
    lock if system is low on memory or one is too fragmented.
    
    Fix it by dropping the lock as soon as we see a block eligible
    for L2ARC writing and pick it up later using earlier inserted
    marker.  While there, also reduce scope of hash lock, moving
    ZIO allocation and other operations not requiring header access
    out of it.  All operations requiring header access move under
    hash lock, since L2_WRITING flag does not prevent header eviction
    only transition to arc_l2c_only state with L1 header.
    
    To be able to manipulate sublist lock and marker as needed add few
    more multilist functions and modify one.
    
    Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
    Sponsored by:	iXsystems, Inc.
    amotin committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    5144490 View commit details
    Browse the repository at this point in the history