summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_extent_busy.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-02-07 14:06:57 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2017-02-09 10:50:25 -0800
commitebf55872616c7d4754db5a318591a72a8d5e6896 (patch)
treefd88d14b7765f0834273807a14ee931519029438 /fs/xfs/xfs_extent_busy.h
parent5e30c23d13919a718b22d4921dc5c0accc59da27 (diff)
downloadlinux-ebf55872616c7d4754db5a318591a72a8d5e6896.tar.bz2
xfs: improve handling of busy extents in the low-level allocator
Currently we force the log and simply try again if we hit a busy extent, but especially with online discard enabled it might take a while after the log force for the busy extents to disappear, and we might have already completed our second pass. So instead we add a new waitqueue and a generation counter to the pag structure so that we can do wakeups once we've removed busy extents, and we replace the single retry with an unconditional one - after all we hold the AGF buffer lock, so no other allocations or frees can be racing with us in this AG. 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_extent_busy.h')
-rw-r--r--fs/xfs/xfs_extent_busy.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/xfs/xfs_extent_busy.h b/fs/xfs/xfs_extent_busy.h
index bfff284d2dcc..60195ea1b84a 100644
--- a/fs/xfs/xfs_extent_busy.h
+++ b/fs/xfs/xfs_extent_busy.h
@@ -58,9 +58,16 @@ void
xfs_extent_busy_reuse(struct xfs_mount *mp, xfs_agnumber_t agno,
xfs_agblock_t fbno, xfs_extlen_t flen, bool userdata);
+bool
+xfs_extent_busy_trim(struct xfs_alloc_arg *args, xfs_agblock_t *bno,
+ xfs_extlen_t *len, unsigned *busy_gen);
+
+void
+xfs_extent_busy_flush(struct xfs_mount *mp, struct xfs_perag *pag,
+ unsigned busy_gen);
+
void
-xfs_extent_busy_trim(struct xfs_alloc_arg *args, xfs_agblock_t bno,
- xfs_extlen_t len, xfs_agblock_t *rbno, xfs_extlen_t *rlen);
+xfs_extent_busy_wait_all(struct xfs_mount *mp);
int
xfs_extent_busy_ag_cmp(void *priv, struct list_head *a, struct list_head *b);