freebsd-dev/module/zfs
Brian Behlendorf 2fac4c2a74 Make tgx_sync_thread zio's async
The majority of the recursive operations performed by the dsl
are done either in the context of the tgx_sync_thread or during
pool import.  It is these recursive operations which contribute
greatly to the stack depth.  When this recursion is coupled with
a synchronous I/O in the same context overflow becomes possible.

Previously to handle this case I have focused on keeping the
individual stack frames as light as possible.  This is a good
idea as long as it can be done in a way which doesn't overly
complicate the code.  However, there is a better solution.

If we treat all zio's issued by the tgx_sync_thread as async then
we can use the tgx_sync_thread stack for the recursive parts, and
the zio_* threads for the I/O parts.  This effectively doubles our
available stack space with the only drawback being a small delay
to schedule the I/O.  However, in practice the scheduling time
is so much smaller than the actual I/O time this isn't an issue.
Another benefit of making the zio async is that the zio pipeline
is now parallel.  That should mean for CPU intensive pipelines
such as compression or dedup performance may be improved.

With this change in place the worst case stack usage observed so
far is 6902 bytes.  This is still higher than I'd like but
significantly improved.  Additional changes to specific functions
should improve this further.  This change allows us to revent
commit 6656bf5 which did some horrible things to the recursive
traverse_visitbp() callpath in the name of saving stack.
2011-05-31 12:17:27 -07:00
..
arc.c Fix 'negative objects to delete' warning 2011-05-18 10:29:22 -07:00
bplist.c Fix gcc missing parenthesis warnings 2010-08-31 08:38:35 -07:00
bpobj.c Update to onnv_147 2010-08-26 14:24:34 -07:00
dbuf.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
ddt_zap.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
ddt.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dmu_diff.c Update to onnv_147 2010-08-26 14:24:34 -07:00
dmu_object.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dmu_objset.c Merge branch 'zpl' 2011-02-18 09:31:25 -08:00
dmu_send.c Add linux kernel memory support 2010-08-31 13:41:57 -07:00
dmu_traverse.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dmu_tx.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dmu_zfetch.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dmu.c Suppress large kmem_alloc() warning 2011-02-10 09:27:22 -08:00
dnode_sync.c Fix dbuf eviction assertion 2010-08-31 08:38:45 -07:00
dnode.c Quiet down very frequent large allocation warning in ZFS. 2010-09-17 16:24:15 -07:00
dsl_dataset.c Prototype/structure update for Linux 2011-02-10 09:27:21 -08:00
dsl_deadlist.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
dsl_deleg.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dsl_dir.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
dsl_pool.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dsl_prop.c Fix enum compiler warning 2011-02-23 12:52:51 -08:00
dsl_scan.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
dsl_synctask.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
fm.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
gzip.c Fix zmod.h usage in userspace 2010-08-31 08:38:46 -07:00
lzjb.c Fix stack lzjb 2010-08-31 08:38:49 -07:00
Makefile.in Implemented NFS export_operations. 2011-04-29 12:36:13 -07:00
metaslab.c Fix metaslab 2010-08-31 08:38:45 -07:00
refcount.c Fix gcc uninitialized variable warnings 2010-08-31 08:38:43 -07:00
rrwlock.c Enable rrwlock.c compilation 2010-12-07 16:05:25 -08:00
sa.c Enable zfs_znode compilation 2011-02-10 09:27:20 -08:00
sha256.c Add linux sha2 support 2010-08-31 13:41:59 -07:00
spa_boot.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
spa_config.c Prototype/structure update for Linux 2011-02-10 09:27:21 -08:00
spa_errlog.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
spa_history.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
spa_misc.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
spa.c Disable direct reclaim for z_wr_* threads 2011-05-06 15:26:26 -07:00
space_map.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
txg.c Fix ASSERTION(!dsl_pool_sync_context(tx->tx_pool)) 2011-04-07 09:52:16 -07:00
uberblock.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
unique.c Fix gcc ident pragma warnings 2010-08-27 15:34:02 -07:00
vdev_cache.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
vdev_disk.c Fix 4K sector support 2011-05-27 11:38:53 -07:00
vdev_file.c Prototype/structure update for Linux 2011-02-10 09:27:21 -08:00
vdev_label.c Fix gcc uninitialized variable warnings 2010-08-31 08:38:43 -07:00
vdev_mirror.c Fix gcc c90 compliance warnings 2010-08-27 15:28:32 -07:00
vdev_missing.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
vdev_queue.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
vdev_raidz.c Fix variables named current 2010-08-31 08:38:44 -07:00
vdev_root.c Fix gcc c90 compliance warnings 2010-08-27 15:28:32 -07:00
vdev.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
zap_leaf.c Fix gcc uninitialized variable warnings 2010-08-31 08:38:43 -07:00
zap_micro.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
zap.c Fix rw_init() usage 2010-08-31 08:38:46 -07:00
zfs_acl.c Prototype/structure update for Linux 2011-02-10 09:27:21 -08:00
zfs_byteswap.c Add linux kernel module support 2010-08-31 13:41:58 -07:00
zfs_debug.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zfs_dir.c Added missing initialization for va.va_dentry in zfs_get_xattrdir. 2011-04-19 13:57:41 -07:00
zfs_fm.c Initial zio delay timing 2010-10-12 14:55:02 -07:00
zfs_fuid.c Drop HAVE_XVATTR macros 2011-03-02 11:44:34 -08:00
zfs_ioctl.c Use vmem_alloc() for zfs_ioc_userspace_many() 2011-05-20 14:23:18 -07:00
zfs_log.c Drop HAVE_XVATTR macros 2011-03-02 11:44:34 -08:00
zfs_onexit.c Add linux kernel device support 2010-08-31 13:41:50 -07:00
zfs_replay.c Use Linux ATTR_ versions 2011-03-03 11:29:15 -08:00
zfs_rlock.c Range lock performance improvements 2011-03-08 12:44:06 -08:00
zfs_sa.c Drop HAVE_XVATTR macros 2011-03-02 11:44:34 -08:00
zfs_vfsops.c Implemented NFS export_operations. 2011-04-29 12:36:13 -07:00
zfs_vnops.c Update synchronous open zfs_close() comment 2011-05-13 08:20:06 -07:00
zfs_znode.c Don't store rdev in SA for FIFOs and sockets 2011-05-09 13:35:07 -07:00
zil.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
zio_checksum.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zio_compress.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zio_inject.c Add missing ZFS tunables 2011-05-04 10:02:37 -07:00
zio.c Make tgx_sync_thread zio's async 2011-05-31 12:17:27 -07:00
zle.c Update core ZFS code from build 121 to build 141. 2010-05-28 13:45:14 -07:00
zpl_export.c Implemented NFS export_operations. 2011-04-29 12:36:13 -07:00
zpl_file.c Handle NULL in nfsd .fsync() hook 2011-05-06 12:33:45 -07:00
zpl_inode.c Don't store rdev in SA for FIFOs and sockets 2011-05-09 13:35:07 -07:00
zpl_super.c Implemented NFS export_operations. 2011-04-29 12:36:13 -07:00
zpl_xattr.c Truncate the xattr znode when updating existing attributes. 2011-04-19 14:14:40 -07:00
zrlock.c Export ZFS symbols needed by Lustre. 2010-09-17 16:24:15 -07:00
zvol.c Fix 'zfs set volsize=N pool/dataset' 2011-05-02 08:54:40 -07:00