Skip to content

Commit ba5ad9a

Browse files
grwilsonbehlendorf
authored andcommitted
Illumos 6251 - add tunable to disable free_bpobj processing
6251 - add tunable to disable free_bpobj processing Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Simon Klinkert <simon.klinkert@gmail.com> Reviewed by: Richard Elling <Richard.Elling@RichardElling.com> Reviewed by: Albert Lee <trisk@omniti.com> Reviewed by: Xin Li <delphij@freebsd.org> Approved by: Garrett D'Amore <garrett@damore.org> References: https://www.illumos.org/issues/6251 illumos/illumos-gate@139510f Porting notes: - Added as module option declaration. - Added to zfs-module-parameters.5 man page. Ported-by: Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
1 parent 0a1f8cd commit ba5ad9a

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

man/man5/zfs-module-parameters.5

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,17 @@ Start syncing out a transaction group if there is at least this much dirty data.
784784
Default value: \fB67,108,864\fR.
785785
.RE
786786

787+
.sp
788+
.ne 2
789+
.na
790+
\fBzfs_free_bpobj_enabled\fR (int)
791+
.ad
792+
.RS 12n
793+
Enable/disable the processing of the free_bpobj object.
794+
.sp
795+
Default value: \fB1\fR.
796+
.RE
797+
787798
.sp
788799
.ne 2
789800
.na

module/zfs/dsl_scan.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
/*
2222
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
23-
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
23+
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
2424
*/
2525

2626
#include <sys/dsl_scan.h>
@@ -76,6 +76,11 @@ ulong zfs_free_max_blocks = 100000;
7676
((scn)->scn_phys.scn_func == POOL_SCAN_SCRUB || \
7777
(scn)->scn_phys.scn_func == POOL_SCAN_RESILVER)
7878

79+
/*
80+
* Enable/disable the processing of the free_bpobj object.
81+
*/
82+
int zfs_free_bpobj_enabled = 1;
83+
7984
/* the order has to match pool_scan_type */
8085
static scan_cb_t *scan_funcs[POOL_SCAN_FUNCS] = {
8186
NULL,
@@ -1502,7 +1507,8 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx)
15021507
* have to worry about traversing it. It is also faster to free the
15031508
* blocks than to scrub them.
15041509
*/
1505-
if (spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) {
1510+
if (zfs_free_bpobj_enabled &&
1511+
spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) {
15061512
scn->scn_is_bptree = B_FALSE;
15071513
scn->scn_zio_root = zio_root(dp->dp_spa, NULL,
15081514
NULL, ZIO_FLAG_MUSTSUCCEED);
@@ -1918,4 +1924,7 @@ MODULE_PARM_DESC(zfs_no_scrub_prefetch, "Set to disable scrub prefetching");
19181924

19191925
module_param(zfs_free_max_blocks, ulong, 0644);
19201926
MODULE_PARM_DESC(zfs_free_max_blocks, "Max number of blocks freed in one txg");
1927+
1928+
module_param(zfs_free_bpobj_enabled, int, 0644);
1929+
MODULE_PARM_DESC(zfs_free_bpobj_enabled, "Enable processing of the free_bpobj");
19211930
#endif

0 commit comments

Comments
 (0)