Project

General

Profile

Actions

Bug #13317

closed

Decrease contention on dn_struct_rwlock

Added by Jason King over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
zfs - Zettabyte File System
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Port of OpenZFS #8946:

Currently, sequential async write workloads spend a lot of time
contending on the dn_struct_rwlock. This lock is responsible for
protecting the entire block tree below it; this naturally results
in some serialization during heavy write workloads. This can be
resolved by having per-dbuf locking, which will allow multiple
writers in the same object at the same time.

We introduce a new rwlock, the db_rwlock. This lock is responsible
for protecting the contents of the dbuf that it is a part of; when
reading a block pointer from a dbuf, you hold the lock as a reader.
When writing data to a dbuf, you hold it as a writer. This allows
multiple threads to write to different parts of a file at the same
time.

Reviewed by: Brad Lewis <>
Reviewed by: Matt Ahrens
Reviewed by: George Wilson
Reviewed-by: Brian Behlendorf <>
Signed-off-by: Paul Dagnelie <>
External-issue: DLPX-52564
External-issue: DLPX-53085
External-issue: DLPX-57384
Closes #8946

This is mostly to simplify porting some additional L2ARC changes, but improved write parallelism is a bonus.


Related issues

Related to illumos gate - Bug #13937: 13317 mismerged; leaked rwlock counts on bonus' parents ensueNew

Actions
Actions #1

Updated by Electric Monk over 2 years ago

  • Gerrit CR set to 1064
Actions #2

Updated by Jason King over 2 years ago

To test, I ran the zfs test suite. The only failures were tests with known issues (and existing tickets filed for them).

Actions #4

Updated by Electric Monk over 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 9704bf7fb82e71b685e194a967937ff03843e73a

commit  9704bf7fb82e71b685e194a967937ff03843e73a
Author: Paul Dagnelie <pcd@delphix.com>
Date:   2020-12-18T17:21:36.000Z

    13317 Decrease contention on dn_struct_rwlock
    Portions contributed by: Jason King <jason.king@joyent.com>
    Reviewed by: Brad Lewis <brad.lewis@delphix.com>
    Reviewed by: Matt Ahrens matt@delphix.com
    Reviewed by: George Wilson george.wilson@delphix.com
    Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions #5

Updated by Joshua M. Clulow almost 2 years ago

  • Related to Bug #13937: 13317 mismerged; leaked rwlock counts on bonus' parents ensue added
Actions

Also available in: Atom PDF