summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorChristoph Hellwig2017-02-07 23:07:58 +0100
committerDarrick J. Wong2017-02-09 20:36:40 +0100
commit4560e78f40cb55bd2ea8f1ef4001c5baa88531c7 (patch)
tree8dc0b7babd87706130fbc1f7acc86f53eb6754a7 /fs/xfs/xfs_super.c
parentxfs: improve busy extent sorting (diff)
downloadkernel-qcow2-linux-4560e78f40cb55bd2ea8f1ef4001c5baa88531c7.tar.gz
kernel-qcow2-linux-4560e78f40cb55bd2ea8f1ef4001c5baa88531c7.tar.xz
kernel-qcow2-linux-4560e78f40cb55bd2ea8f1ef4001c5baa88531c7.zip
xfs: don't block the log commit handler for discards
Instead we submit the discard requests and use another workqueue to release the extents from the extent busy list. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index eecbaac08eba..890862f2447c 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1956,12 +1956,20 @@ xfs_init_workqueues(void)
if (!xfs_alloc_wq)
return -ENOMEM;
+ xfs_discard_wq = alloc_workqueue("xfsdiscard", WQ_UNBOUND, 0);
+ if (!xfs_discard_wq)
+ goto out_free_alloc_wq;
+
return 0;
+out_free_alloc_wq:
+ destroy_workqueue(xfs_alloc_wq);
+ return -ENOMEM;
}
STATIC void
xfs_destroy_workqueues(void)
{
+ destroy_workqueue(xfs_discard_wq);
destroy_workqueue(xfs_alloc_wq);
}