diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-03 17:50:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-03 17:50:19 -0400 |
commit | 2f9d3df8aa1cc3c6db5cfa0bad3f0745e04cc27d (patch) | |
tree | f5cb17f1db0e8308eae0c7271c1d2dc86851c95d /include/linux/fs.h | |
parent | f8f5701bdaf9134b1f90e5044a82c66324d2073f (diff) |
vfs: move inode stat information closer together
The comment above it says "Stat data, not accessed from path walking",
but in fact some of inode fields we use for the common stat data was way
down at the end of the inode, causing unnecessary cache misses for the
common stat operations.
The inode structure is pretty big, and this can change padding depending
on field width, but at least on the common 64-bit configurations this
doesn't change the size. Some of our inode layout has historically been
to tro to avoid unnecessary padding fields, but cache locality is at
least as important for layout, if not more.
Noticed by looking at kernel profiles, and noticing that the "i_blkbits"
access stood out like a sore thumb.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 51978ed43e97..17fd887c798f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -802,13 +802,14 @@ struct inode { | |||
802 | unsigned int __i_nlink; | 802 | unsigned int __i_nlink; |
803 | }; | 803 | }; |
804 | dev_t i_rdev; | 804 | dev_t i_rdev; |
805 | loff_t i_size; | ||
805 | struct timespec i_atime; | 806 | struct timespec i_atime; |
806 | struct timespec i_mtime; | 807 | struct timespec i_mtime; |
807 | struct timespec i_ctime; | 808 | struct timespec i_ctime; |
808 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 809 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
809 | unsigned short i_bytes; | 810 | unsigned short i_bytes; |
811 | unsigned int i_blkbits; | ||
810 | blkcnt_t i_blocks; | 812 | blkcnt_t i_blocks; |
811 | loff_t i_size; | ||
812 | 813 | ||
813 | #ifdef __NEED_I_SIZE_ORDERED | 814 | #ifdef __NEED_I_SIZE_ORDERED |
814 | seqcount_t i_size_seqcount; | 815 | seqcount_t i_size_seqcount; |
@@ -828,9 +829,8 @@ struct inode { | |||
828 | struct list_head i_dentry; | 829 | struct list_head i_dentry; |
829 | struct rcu_head i_rcu; | 830 | struct rcu_head i_rcu; |
830 | }; | 831 | }; |
831 | atomic_t i_count; | ||
832 | unsigned int i_blkbits; | ||
833 | u64 i_version; | 832 | u64 i_version; |
833 | atomic_t i_count; | ||
834 | atomic_t i_dio_count; | 834 | atomic_t i_dio_count; |
835 | atomic_t i_writecount; | 835 | atomic_t i_writecount; |
836 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 836 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |