]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: add kmem allocation trace points
authorDave Chinner <dchinner@redhat.com>
Fri, 13 Dec 2019 00:54:33 +0000 (19:54 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 13 Dec 2019 00:54:33 +0000 (19:54 -0500)
Source kernel commit: 0ad95687c3adb91e762d0f6ea50a6b1137300e19

When trying to correlate XFS kernel allocations to memory reclaim
behaviour, it is useful to know what allocations XFS is actually
attempting. This information is not directly available from
tracepoints in the generic memory allocation and reclaim
tracepoints, so these new trace points provide a high level
indication of what the XFS memory demand actually is.

There is no per-filesystem context in this code, so we just trace
the type of allocation, the size and the allocation constraints.
The kmem code also doesn't include much of the common XFS headers,
so there are a few definitions that need to be added to the trace
headers and a couple of types that need to be made common to avoid
needing to include the whole world in the kmem code.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/xfs_mount.h
libxfs/xfs_types.h

index 5c182f03fce8afec5a86010bd80d5bf51137a8f4..efbf3aff946e5471bcb125f678f8186239181d96 100644 (file)
@@ -109,14 +109,6 @@ typedef struct xfs_mount {
 
 #define M_IGEO(mp)             (&(mp)->m_ino_geo)
 
-/* per-AG block reservation data structures*/
-enum xfs_ag_resv_type {
-       XFS_AG_RESV_NONE = 0,
-       XFS_AG_RESV_AGFL,
-       XFS_AG_RESV_METADATA,
-       XFS_AG_RESV_RMAPBT,
-};
-
 struct xfs_ag_resv {
        /* number of blocks originally reserved here */
        xfs_extlen_t    ar_orig_reserved;
index 802b34cd10fe08fa8612274f46c7ab1007894762..300b3e91ca3ade672d1443badefd89b937b2400d 100644 (file)
@@ -169,6 +169,14 @@ typedef struct xfs_bmbt_irec
        xfs_exntst_t    br_state;       /* extent state */
 } xfs_bmbt_irec_t;
 
+/* per-AG block reservation types */
+enum xfs_ag_resv_type {
+       XFS_AG_RESV_NONE = 0,
+       XFS_AG_RESV_AGFL,
+       XFS_AG_RESV_METADATA,
+       XFS_AG_RESV_RMAPBT,
+};
+
 /*
  * Type verifier functions
  */