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

Implement parallel dbuf eviction #16487

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 12, 2024

  1. Implement parallel dbuf eviction

    In the previous code, dbuf_evict_thread() would called dbuf_evict_one()
    in a look while dbuf_cache_above_lowater().
    
    dbuf_evict_one() would select a random sublist from the dbuf cache,
    then walk it from the tail forward, attempting to acquire the lock on
    each object until it succeeded, then evict that object and return.
    
    As the name suggests, it would evict only a single object from the
    cache. However, evicting one object is not likely to bring us below the
    desired low water mark, so dbuf_evict_one() will be called again, where
    it will loop over all of the same busy objects again, until it founds
    one it can evict.
    
    This has been replaced with dbuf_evict_many() which takes a specific
    sublist as a parameter, as well as a desired amount of data to evict.
    It then walks the sublist from the tail forward, evicting what it can
    until the number of bytes evicted satisfies the input parameter or
    the head of the sublist is reached.
    
    The dbuf_evict_thread now runs is parallel as well, allowing it to
    keep up with demand more easily. For the dbuf cache, if the single
    thread was not able to keep up, ZFS would shift the work of evicting
    some items to each incoming I/O thread. While that is still the case
    it should be seen much less often now that dbuf_evict is more efficient
    and no longer bottlenecked to a single thread.
    
    Sponsored-by: Expensify, Inc.
    Sponsored-by: Klara, Inc.
    Co-authored-by: Allan Jude <[email protected]>
    Co-authored-by: Mateusz Piotrowski <[email protected]>
    Signed-off-by: Alexander Stetsenko <[email protected]>
    Signed-off-by: Allan Jude <[email protected]>
    Signed-off-by: Mateusz Piotrowski <[email protected]>
    3 people committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    883cd30 View commit details
    Browse the repository at this point in the history