aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/dsl_scan.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2011-04-26 15:43:07 -0700
committerBrian Behlendorf <[email protected]>2011-04-26 15:48:00 -0700
commitb81c4ac9af4f9e8b8c27d8011e3ce608cd04737b (patch)
tree20d98f91ecb421b9c30e7d38bec93735ef290bc3 /module/zfs/dsl_scan.c
parent7a060636b05655cccd87ce74d70e5957bb234e5e (diff)
Conserve stack in dsl_scan_visitbp()
This function is called recursively so everything possible must be done to limit its stack consumption. The dprintf_bp() debugging function adds 30 bytes of local variables to the function we cannot afford. By commenting out this debugging we save 30 bytes per recursion and depths of 13 are not uncommon. This yeilds a total stack saving of 390 bytes on our 8k stack. Issue #174
Diffstat (limited to 'module/zfs/dsl_scan.c')
-rw-r--r--module/zfs/dsl_scan.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c
index 421ddd041..e3d2492a2 100644
--- a/module/zfs/dsl_scan.c
+++ b/module/zfs/dsl_scan.c
@@ -809,11 +809,18 @@ dsl_scan_visitbp(blkptr_t *bp, const zbookmark_t *zb,
scn->scn_visited_this_txg++;
- dprintf_bp(bp,
- "visiting ds=%p/%llu zb=%llx/%llx/%llx/%llx buf=%p bp=%p",
- ds, ds ? ds->ds_object : 0,
- zb->zb_objset, zb->zb_object, zb->zb_level, zb->zb_blkid,
- pbuf, bp);
+ /*
+ * This debugging is commented out to conserve stack space. This
+ * function is called recursively and the debugging addes several
+ * bytes to the stack for each call. It can be commented back in
+ * if required to debug an issue in dsl_scan_visitbp().
+ *
+ * dprintf_bp(bp,
+ * "visiting ds=%p/%llu zb=%llx/%llx/%llx/%llx buf=%p bp=%p",
+ * ds, ds ? ds->ds_object : 0,
+ * zb->zb_objset, zb->zb_object, zb->zb_level, zb->zb_blkid,
+ * pbuf, bp);
+ */
if (bp->blk_birth <= scn->scn_phys.scn_cur_min_txg)
goto out;