]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFV r337210: 9577 remove zfs_dbuf_evict_key tsd
authorAlexander Motin <mav@FreeBSD.org>
Fri, 3 Aug 2018 00:01:48 +0000 (00:01 +0000)
committerAlexander Motin <mav@FreeBSD.org>
Fri, 3 Aug 2018 00:01:48 +0000 (00:01 +0000)
commit904eaff3f7847912bc8b5bc725bb329e8a8438cc
treede2dc694bd180b7e65dd1051cbeda8e6c31025a9
parent63ddf13e0d436312036f1115068f0ab528698ad6
parentec0d805c51ad41a06dd98f2f737535063d063812
MFV r337210: 9577 remove zfs_dbuf_evict_key tsd

The zfs_dbuf_evict_key TSD (thread-specific data) is not necessary - we can
instead pass a flag down in a few places to prevent recursive dbuf eviction.
Making this change has 3 benefits:

1. The code semantics are easier to understand.
2. On Linux, performance is improved, because creating/removing TSD values
(by setting to NULL vs non-NULL) is expensive, and we do it very often.
3. According to Nexenta, the current semantics can cause a deadlock when
concurrently calling dmu_objset_evict_dbufs() (which is rare today, but they
are working on a "parallel unmount" change that triggers this more easily)

illumos/illumos-gate@c2919acbea007fa95c709b60d073db9a24526e01

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Matthew Ahrens <mahrens@delphix.com>
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h