Project

General

Profile

Bug #13317

Decrease contention on dn_struct_rwlock

Added by Jason King 12 days ago. Updated 12 days ago.

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

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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.

#1

Updated by Electric Monk 12 days ago

  • Gerrit CR set to 1064

Also available in: Atom PDF