linux/fs/xfs
Dave Chinner e04426b920 xfs: move allocation stack switch up to xfs_bmapi_allocate
Switching stacks are xfs_alloc_vextent can cause deadlocks when we
run out of worker threads on the allocation workqueue. This can
occur because xfs_bmap_btalloc can make multiple calls to
xfs_alloc_vextent() and even if xfs_alloc_vextent() fails it can
return with the AGF locked in the current allocation transaction.

If we then need to make another allocation, and all the allocation
worker contexts are exhausted because the are blocked waiting for
the AGF lock, holder of the AGF cannot get it's xfs-alloc_vextent
work completed to release the AGF.  Hence allocation effectively
deadlocks.

To avoid this, move the stack switch one layer up to
xfs_bmapi_allocate() so that all of the allocation attempts in a
single switched stack transaction occur in a single worker context.
This avoids the problem of an allocation being blocked waiting for
a worker thread whilst holding the AGF.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2012-10-18 17:42:48 -05:00
..
Kconfig
kmem.c
kmem.h
Makefile xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
mrlock.h
time.h
uuid.c
uuid.h
xfs.h
xfs_acl.c
xfs_acl.h
xfs_ag.h
xfs_alloc.c xfs: move allocation stack switch up to xfs_bmapi_allocate 2012-10-18 17:42:48 -05:00
xfs_alloc.h xfs: move allocation stack switch up to xfs_bmapi_allocate 2012-10-18 17:42:48 -05:00
xfs_alloc_btree.c
xfs_alloc_btree.h
xfs_aops.c
xfs_aops.h
xfs_attr.c
xfs_attr.h
xfs_attr_leaf.c
xfs_attr_leaf.h
xfs_attr_sf.h
xfs_bit.c
xfs_bit.h
xfs_bmap.c xfs: move allocation stack switch up to xfs_bmapi_allocate 2012-10-18 17:42:48 -05:00
xfs_bmap.h xfs: move allocation stack switch up to xfs_bmapi_allocate 2012-10-18 17:42:48 -05:00
xfs_bmap_btree.c
xfs_bmap_btree.h
xfs_btree.c
xfs_btree.h
xfs_buf.c
xfs_buf.h
xfs_buf_item.c
xfs_buf_item.h
xfs_da_btree.c
xfs_da_btree.h
xfs_dfrag.c
xfs_dfrag.h
xfs_dinode.h
xfs_dir2.c
xfs_dir2.h
xfs_dir2_block.c
xfs_dir2_data.c
xfs_dir2_format.h
xfs_dir2_leaf.c
xfs_dir2_node.c
xfs_dir2_priv.h
xfs_dir2_sf.c
xfs_discard.c
xfs_discard.h
xfs_dquot.c
xfs_dquot.h
xfs_dquot_item.c
xfs_dquot_item.h
xfs_error.c
xfs_error.h
xfs_export.c xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_export.h
xfs_extent_busy.c
xfs_extent_busy.h
xfs_extfree_item.c
xfs_extfree_item.h
xfs_file.c xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_filestream.c
xfs_filestream.h
xfs_fs.h
xfs_fs_subr.c
xfs_fsops.c
xfs_fsops.h
xfs_globals.c
xfs_ialloc.c xfs: zero allocation_args on the kernel stack 2012-10-18 17:34:16 -05:00
xfs_ialloc.h
xfs_ialloc_btree.c
xfs_ialloc_btree.h
xfs_icache.c xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_icache.h xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_inode.c xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_inode.h xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_inode_item.c
xfs_inode_item.h
xfs_inum.h
xfs_ioctl.c
xfs_ioctl.h
xfs_ioctl32.c
xfs_ioctl32.h
xfs_iomap.c xfs: introduce XFS_BMAPI_STACK_SWITCH 2012-10-18 17:41:56 -05:00
xfs_iomap.h
xfs_iops.c
xfs_iops.h
xfs_itable.c xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_itable.h
xfs_linux.h
xfs_log.c xfs: only update the last_sync_lsn when a transaction completes 2012-10-17 13:43:35 -05:00
xfs_log.h xfs: xfs_quiesce_attr() should quiesce the log like unmount 2012-10-17 13:39:14 -05:00
xfs_log_cil.c
xfs_log_priv.h xfs: sync work is now only periodic log work 2012-10-17 11:53:29 -05:00
xfs_log_recover.c xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_log_recover.h
xfs_message.c
xfs_message.h
xfs_mount.c xfs: rename xfs_sync.[ch] to xfs_icache.[ch] 2012-10-17 13:40:09 -05:00
xfs_mount.h xfs: rename xfs_sync.[ch] to xfs_icache.[ch] 2012-10-17 13:40:09 -05:00
xfs_mru_cache.c
xfs_mru_cache.h
xfs_qm.c xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_qm.h
xfs_qm_bhv.c
xfs_qm_syscalls.c xfs: rename xfs_sync.[ch] to xfs_icache.[ch] 2012-10-17 13:40:09 -05:00
xfs_quota.h
xfs_quota_priv.h
xfs_quotaops.c
xfs_rename.c
xfs_rtalloc.c xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_rtalloc.h
xfs_sb.h
xfs_stats.c
xfs_stats.h
xfs_super.c xfs: rename xfs_sync.[ch] to xfs_icache.[ch] 2012-10-17 13:40:09 -05:00
xfs_super.h xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_sysctl.c
xfs_sysctl.h
xfs_trace.c
xfs_trace.h
xfs_trans.c
xfs_trans.h
xfs_trans_ail.c
xfs_trans_buf.c
xfs_trans_dquot.c
xfs_trans_extfree.c
xfs_trans_inode.c
xfs_trans_priv.h
xfs_trans_space.h
xfs_types.h
xfs_utils.c
xfs_utils.h
xfs_vnode.h
xfs_vnodeops.c xfs: remove xfs_iget.c 2012-10-17 13:42:25 -05:00
xfs_vnodeops.h
xfs_xattr.c