public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: active inodes stat is broken
@ 2014-12-01 22:34 Dave Chinner
  2014-12-02 13:52 ` Mark Tinguely
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2014-12-01 22:34 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

vn_active only ever gets decremented, so it has a very large
negative number.  Make it track the inode count we currently have
allocated properly so we can easily track the size of the inode
cache via tools like PCP.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 fs/xfs/xfs_icache.c | 3 +++
 fs/xfs/xfs_super.c  | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 92ca910..8bc3d78 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -128,6 +128,7 @@ xfs_inode_free(
 	/* asserts to verify all state is correct here */
 	ASSERT(atomic_read(&ip->i_pincount) == 0);
 	ASSERT(!xfs_isiflocked(ip));
+	XFS_STATS_DEC(vn_active);
 
 	call_rcu(&VFS_I(ip)->i_rcu, xfs_inode_free_callback);
 }
@@ -287,6 +288,8 @@ xfs_iget_cache_miss(
 	if (!ip)
 		return -ENOMEM;
 
+	XFS_STATS_INC(vn_active);
+
 	error = xfs_iread(mp, tp, ip, flags);
 	if (error)
 		goto out_destroy;
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index fee11c8..6b95851 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1005,7 +1005,6 @@ xfs_fs_evict_inode(
 	clear_inode(inode);
 	XFS_STATS_INC(vn_rele);
 	XFS_STATS_INC(vn_remove);
-	XFS_STATS_DEC(vn_active);
 
 	xfs_inactive(ip);
 }
-- 
2.0.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-02 22:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-01 22:34 [PATCH] xfs: active inodes stat is broken Dave Chinner
2014-12-02 13:52 ` Mark Tinguely
2014-12-02 21:02   ` Dave Chinner
2014-12-02 22:34     ` [PATCH v2] " Dave Chinner
2014-12-02 22:45       ` Mark Tinguely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox