aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2010-10-23 06:55:17 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-25 21:26:09 -0400
commit9e38d86ff2d8a8db99570e982230861046df32b5 (patch)
tree7ea2ceea24a4e070259a4585b2748c9e2c070ee0 /include/linux/fs.h
parentcffbc8aa334f55c9ed42d25202eb3ebf3a97c195 (diff)
fs: Implement lazy LRU updates for inodes
Convert the inode LRU to use lazy updates to reduce lock and cacheline traffic. We avoid moving inodes around in the LRU list during iget/iput operations so these frequent operations don't need to access the LRUs. Instead, we defer the refcount checks to reclaim-time and use a per-inode state flag, I_REFERENCED, to tell reclaim that iget has touched the inode in the past. This means that only reclaim should be touching the LRU with any frequency, hence significantly reducing lock acquisitions and the amount contention on LRU updates. This also removes the inode_in_use list, which means we now only have one list for tracking the inode LRU status. This makes it much simpler to split out the LRU list operations under it's own lock. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a3937a8ee95e..876275fc0638 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1641,16 +1641,17 @@ struct super_operations {
1641 * 1641 *
1642 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1642 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1643 */ 1643 */
1644#define I_DIRTY_SYNC 1 1644#define I_DIRTY_SYNC (1 << 0)
1645#define I_DIRTY_DATASYNC 2 1645#define I_DIRTY_DATASYNC (1 << 1)
1646#define I_DIRTY_PAGES 4 1646#define I_DIRTY_PAGES (1 << 2)
1647#define __I_NEW 3 1647#define __I_NEW 3
1648#define I_NEW (1 << __I_NEW) 1648#define I_NEW (1 << __I_NEW)
1649#define I_WILL_FREE 16 1649#define I_WILL_FREE (1 << 4)
1650#define I_FREEING 32 1650#define I_FREEING (1 << 5)
1651#define I_CLEAR 64 1651#define I_CLEAR (1 << 6)
1652#define __I_SYNC 7 1652#define __I_SYNC 7
1653#define I_SYNC (1 << __I_SYNC) 1653#define I_SYNC (1 << __I_SYNC)
1654#define I_REFERENCED (1 << 8)
1654 1655
1655#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1656#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1656 1657