diff options
author | Dave Chinner <dchinner@redhat.com> | 2012-03-22 01:15:10 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-03-26 18:19:08 -0400 |
commit | 5132ba8f2b7705fb6b06fa6ad3d009233c816b67 (patch) | |
tree | e552a365b600af005abec13f3a1deb1f57bae3b9 /fs/xfs/xfs_inode.h | |
parent | f616137519feb17b849894fcbe634a021d3fa7db (diff) |
xfs: don't cache inodes read through bulkstat
When we read inodes via bulkstat, we generally only read them once
and then throw them away - they never get used again. If we retain
them in cache, then it simply causes the working set of inodes and
other cached items to be reclaimed just so the inode cache can grow.
Avoid this problem by marking inodes read by bulkstat not to be
cached and check this flag in .drop_inode to determine whether the
inode should be added to the VFS LRU or not. If the inode lookup
hits an already cached inode, then don't set the flag. If the inode
lookup hits an inode marked with no cache flag, remove the flag and
allow it to be cached once the current reference goes away.
Inodes marked as not cached will get cleaned up by the background
inode reclaim or via memory pressure, so they will still generate
some short term cache pressure. They will, however, be reclaimed
much sooner and in preference to cache hot inodes.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r-- | fs/xfs/xfs_inode.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index f123dbe6d42a..7fee3387e1c8 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -387,10 +387,11 @@ xfs_set_projid(struct xfs_inode *ip, | |||
387 | #define XFS_IFLOCK (1 << __XFS_IFLOCK_BIT) | 387 | #define XFS_IFLOCK (1 << __XFS_IFLOCK_BIT) |
388 | #define __XFS_IPINNED_BIT 8 /* wakeup key for zero pin count */ | 388 | #define __XFS_IPINNED_BIT 8 /* wakeup key for zero pin count */ |
389 | #define XFS_IPINNED (1 << __XFS_IPINNED_BIT) | 389 | #define XFS_IPINNED (1 << __XFS_IPINNED_BIT) |
390 | #define XFS_IDONTCACHE (1 << 9) /* don't cache the inode long term */ | ||
390 | 391 | ||
391 | /* | 392 | /* |
392 | * Per-lifetime flags need to be reset when re-using a reclaimable inode during | 393 | * Per-lifetime flags need to be reset when re-using a reclaimable inode during |
393 | * inode lookup. Thi prevents unintended behaviour on the new inode from | 394 | * inode lookup. This prevents unintended behaviour on the new inode from |
394 | * ocurring. | 395 | * ocurring. |
395 | */ | 396 | */ |
396 | #define XFS_IRECLAIM_RESET_FLAGS \ | 397 | #define XFS_IRECLAIM_RESET_FLAGS \ |
@@ -553,6 +554,7 @@ do { \ | |||
553 | */ | 554 | */ |
554 | #define XFS_IGET_CREATE 0x1 | 555 | #define XFS_IGET_CREATE 0x1 |
555 | #define XFS_IGET_UNTRUSTED 0x2 | 556 | #define XFS_IGET_UNTRUSTED 0x2 |
557 | #define XFS_IGET_DONTCACHE 0x4 | ||
556 | 558 | ||
557 | int xfs_inotobp(struct xfs_mount *, struct xfs_trans *, | 559 | int xfs_inotobp(struct xfs_mount *, struct xfs_trans *, |
558 | xfs_ino_t, struct xfs_dinode **, | 560 | xfs_ino_t, struct xfs_dinode **, |