]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/arc.c
OpenZFS 7968 - multi-threaded spa_sync()
authorMatthew Ahrens <mahrens@delphix.com>
Tue, 21 Mar 2017 01:36:00 +0000 (18:36 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 21 Mar 2017 01:36:00 +0000 (18:36 -0700)
commit64fc776208ad14b0078b89317b0f3b24338e10c1
treeb8c229ca8b052f3aa718a27b97c759a564c8fd78
parenta3478c074752610814f894375c3d947ece4938fe
OpenZFS 7968 - multi-threaded spa_sync()

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: Matthew Ahrens <mahrens@delphix.com>
spa_sync() iterates over all the dirty dnodes and processes each of them
by calling dnode_sync(). If there are many dirty dnodes (e.g. because we
created or removed a lot of files), the single thread of spa_sync()
calling dnode_sync() can become a bottleneck. Additionally, if many
dnodes are dirtied concurrently in open context (e.g. due to concurrent
file creation), the os_lock will experience lock contention via
dnode_setdirty().

The solution is to track dirty dnodes on a multilist_t, and for
spa_sync() to use separate threads to process each of the sublists in
the multilist.

OpenZFS-issue: https://www.illumos.org/issues/7968
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/4a2a54c
Closes #5752
16 files changed:
include/sys/arc_impl.h
include/sys/dmu_objset.h
include/sys/dnode.h
include/sys/dsl_pool.h
include/sys/multilist.h
include/sys/zio.h
module/zfs/arc.c
module/zfs/dbuf.c
module/zfs/dmu_objset.c
module/zfs/dnode.c
module/zfs/dnode_sync.c
module/zfs/dsl_dataset.c
module/zfs/dsl_pool.c
module/zfs/multilist.c
module/zfs/spa_misc.c
module/zfs/zio.c