summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_shared.h
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-08-01 07:20:31 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-02 23:05:13 -0700
commit1214f1cf663b0939fbb8f1bccdc74c1d1e452d53 (patch)
tree24a8b208cbfff610e5099eab6cdae0f474aad9df /fs/xfs/libxfs/xfs_shared.h
parentce356d64772f920f26cd6c1b02878a737a275638 (diff)
downloadlinux-1214f1cf663b0939fbb8f1bccdc74c1d1e452d53.tar.gz
linux-1214f1cf663b0939fbb8f1bccdc74c1d1e452d53.tar.bz2
linux-1214f1cf663b0939fbb8f1bccdc74c1d1e452d53.zip
xfs: replace dop_low with transaction flag
The dop_low field enables the low free space allocation mode when a previous allocation has detected difficulty allocating blocks. It has historically been part of the xfs_defer_ops structure, which means if enabled, it remains enabled across a set of transactions until the deferred operations have completed and the dfops is reset. Now that the dfops is embedded in the transaction, we can save a bit more space by using a transaction flag rather than a standalone boolean. Drop the ->dop_low field and replace it with a transaction flag that is set at the same points, carried across rolling transactions and cleared on completion of deferred operations. This essentially emulates the behavior of ->dop_low and so should not change behavior. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_shared.h')
-rw-r--r--fs/xfs/libxfs/xfs_shared.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_shared.h b/fs/xfs/libxfs/xfs_shared.h
index 22089f1c880a..1c5debe748f0 100644
--- a/fs/xfs/libxfs/xfs_shared.h
+++ b/fs/xfs/libxfs/xfs_shared.h
@@ -64,6 +64,18 @@ void xfs_log_get_max_trans_res(struct xfs_mount *mp,
#define XFS_TRANS_RESERVE 0x20 /* OK to use reserved data blocks */
#define XFS_TRANS_NO_WRITECOUNT 0x40 /* do not elevate SB writecount */
#define XFS_TRANS_NOFS 0x80 /* pass KM_NOFS to kmem_alloc */
+/*
+ * LOWMODE is used by the allocator to activate the lowspace algorithm - when
+ * free space is running low the extent allocator may choose to allocate an
+ * extent from an AG without leaving sufficient space for a btree split when
+ * inserting the new extent. In this case the allocator will enable the
+ * lowspace algorithm which is supposed to allow further allocations (such as
+ * btree splits and newroots) to allocate from sequential AGs. In order to
+ * avoid locking AGs out of order the lowspace algorithm will start searching
+ * for free space from AG 0. If the correct transaction reservations have been
+ * made then this algorithm will eventually find all the space it needs.
+ */
+#define XFS_TRANS_LOWMODE 0x100 /* allocate in low space mode */
/*
* Field values for xfs_trans_mod_sb.