diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-08 18:18:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-08 18:18:19 -0400 |
commit | 13e12d14e2dccc7995b8f15a5678a338ab4e6a8c (patch) | |
tree | d0fc2752fc71d30710a909516d5317b2c7bb8b96 /include/linux/fs.h | |
parent | 95f4efb2d78661065aaf0be57f5bf00e4d2aea1d (diff) |
vfs: reorganize 'struct inode' layout a bit
This tries to make the 'struct inode' accesses denser in the data cache
by moving a commonly accessed field (i_security) closer to other fields
that are accessed often.
It also makes 'i_state' just an 'unsigned int' rather than 'unsigned
long', since we only use a few bits of that field, and moves it next to
the existing 'i_flags' so that we potentially get better structure
layout (although depending on config options, i_flags may already have
packed in the same word as i_lock, so this improves packing only for the
case of spinlock debugging)
Out 'struct inode' is still way too big, and we should probably move
some other fields around too (the acl fields in particular) for better
data cache access density. Other fields (like the inode hash) are
likely to be entirely irrelevant under most loads.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 646a1836152a..1c777878f1ea 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -744,9 +744,13 @@ struct inode { | |||
744 | 744 | ||
745 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 745 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
746 | unsigned int i_flags; | 746 | unsigned int i_flags; |
747 | unsigned int i_state; | ||
748 | #ifdef CONFIG_SECURITY | ||
749 | void *i_security; | ||
750 | #endif | ||
747 | struct mutex i_mutex; | 751 | struct mutex i_mutex; |
748 | 752 | ||
749 | unsigned long i_state; | 753 | |
750 | unsigned long dirtied_when; /* jiffies of first dirtying */ | 754 | unsigned long dirtied_when; /* jiffies of first dirtying */ |
751 | 755 | ||
752 | struct hlist_node i_hash; | 756 | struct hlist_node i_hash; |
@@ -798,9 +802,6 @@ struct inode { | |||
798 | atomic_t i_readcount; /* struct files open RO */ | 802 | atomic_t i_readcount; /* struct files open RO */ |
799 | #endif | 803 | #endif |
800 | atomic_t i_writecount; | 804 | atomic_t i_writecount; |
801 | #ifdef CONFIG_SECURITY | ||
802 | void *i_security; | ||
803 | #endif | ||
804 | #ifdef CONFIG_FS_POSIX_ACL | 805 | #ifdef CONFIG_FS_POSIX_ACL |
805 | struct posix_acl *i_acl; | 806 | struct posix_acl *i_acl; |
806 | struct posix_acl *i_default_acl; | 807 | struct posix_acl *i_default_acl; |