fs: shave 8 bytes off of struct inode
authorAmir Goldstein <amir73il@gmail.com>
Thu, 5 Jul 2018 06:25:43 +0000 (09:25 +0300)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 8 Jul 2018 23:58:24 +0000 (19:58 -0400)
Here is a link to Linus' reply to Jan's concern about making
i_blkbibts byte addressable:
https://marc.info/?l=linux-fsdevel&m=152882624707975&w=2

Here is a link to an lkp.org report about potential performance
improvement in some workload, which could(?) be related to packing
i_blkbits closer to i_bytes/i_lock:
https://marc.info/?l=linux-fsdevel&m=153077048108198&w=2

Changes since v1:
- Add links to relevant discussions

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/linux/fs.h

index f140c11d35dd6fae23cb92c64705e6bc84dfb0ef..9b00676f5d9d28fa1690c2048be381d6f1c512a2 100644 (file)
@@ -275,6 +275,7 @@ struct writeback_control;
 
 /*
  * Write life time hint values.
 
 /*
  * Write life time hint values.
+ * Stored in struct inode as u8.
  */
 enum rw_hint {
        WRITE_LIFE_NOT_SET      = 0,
  */
 enum rw_hint {
        WRITE_LIFE_NOT_SET      = 0,
@@ -609,8 +610,8 @@ struct inode {
        struct timespec64       i_ctime;
        spinlock_t              i_lock; /* i_blocks, i_bytes, maybe i_size */
        unsigned short          i_bytes;
        struct timespec64       i_ctime;
        spinlock_t              i_lock; /* i_blocks, i_bytes, maybe i_size */
        unsigned short          i_bytes;
-       unsigned int            i_blkbits;
-       enum rw_hint            i_write_hint;
+       u8                      i_blkbits;
+       u8                      i_write_hint;
        blkcnt_t                i_blocks;
 
 #ifdef __NEED_I_SIZE_ORDERED
        blkcnt_t                i_blocks;
 
 #ifdef __NEED_I_SIZE_ORDERED