]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFZol: Fix performance of "zfs recv" with many deletions
authorasomers <asomers@FreeBSD.org>
Fri, 11 Oct 2019 14:59:28 +0000 (14:59 +0000)
committerasomers <asomers@FreeBSD.org>
Fri, 11 Oct 2019 14:59:28 +0000 (14:59 +0000)
commited8e9e6d05aee5f68374cf9c68b920be0c3a43f0
treed662bc3cff3823e574808adafb06b25dd6275c7d
parentbd2df1a0b7329fab5a9e87b9a644e4fca68eb6dc
MFZol: Fix performance of "zfs recv" with many deletions

This patch fixes 2 issues with the DMU free throttle implemented
in dmu_free_long_range(). The first issue is that get_next_chunk()
was calculating the number of L1 blocks the free would dirty
incorrectly. In some cases involving extremely large files, this
code would greatly overestimate the number of affected L1 blocks,
causing excessive calls to txg_wait_open(). This patch corrects
the calculation.

The second issue is that the free throttle uses the total number
of free'd blocks in all (open, quiescing, and syncing) txgs to
determine whether to throttle. This causes large frees (such as
those created by the first issue) to cause 4 txg syncs before
any further frees were allowed to proceed. This patch ensures
that the accounting is done entirely in a per-txg fashion, so
that frees from a given txg don't affect those that immediately
follow it.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
zfsonlinux/zfs@f4c594da94d856c422512a54e48070f890b2685b

Freeing throttle should account for holes

Deletion throttle currently does not account for holes in a file.
This means that it can activate when it shouldn't.
To fix it we switch the throttle to be based on the number of
L1 blocks we will have to dirty when freeing

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alek Pinchuk <apinchuk@datto.com>
zfsonlinux/zfs@65282ee9e06b130f1f0169baf5d9bf0dd8fc1ef9

Submitted by: Alek Pinchuk <pinchuk.alek@gmail.com>
Reviewed by: allanjude
MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D21895
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c