Bug #13317
closedDecrease contention on dn_struct_rwlock
100%
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 <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>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
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
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).
Updated by Dan McDonald over 2 years ago
OpenZFS issue link: https://github.com/openzfs/zfs/pull/8946
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>
Updated by Joshua M. Clulow almost 2 years ago
- Related to Bug #13937: 13317 mismerged; leaked rwlock counts on bonus' parents ensue added