From: Anton Blanchard <anton@samba.org>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] reduce size of struct inode on 64bit
Date: Thu, 26 Aug 2004 14:41:13 +1000 [thread overview]
Message-ID: <20040826044113.GA10843@krispykreme> (raw)
Reduce the size of struct inode on 64bit architectures by reducing padding.
This assumes spinlocks are 32bit or less which is the case on most
architectures.
This reduces inode structs by 24 bytes on ppc64, and on ext2 increases
the number of inodes in a 4kB slab from 5 to 6.
Signed-off-by: Anton Blanchard <anton@samba.org>
--
gr_work-anton/include/linux/fs.h | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff -puN include/linux/fs.h~reduce_inode include/linux/fs.h
--- gr_work/include/linux/fs.h~reduce_inode 2004-08-25 22:38:03.543805050 -0500
+++ gr_work-anton/include/linux/fs.h 2004-08-25 22:38:03.556802993 -0500
@@ -335,14 +335,14 @@ struct address_space {
struct inode *host; /* owner: inode, block_device */
struct radix_tree_root page_tree; /* radix tree of all pages */
spinlock_t tree_lock; /* and spinlock protecting it */
- unsigned long nrpages; /* number of total pages */
- pgoff_t writeback_index;/* writeback starts here */
- struct address_space_operations *a_ops; /* methods */
- struct prio_tree_root i_mmap; /* tree of private mappings */
unsigned int i_mmap_writable;/* count VM_SHARED mappings */
+ struct prio_tree_root i_mmap; /* tree of private mappings */
struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
spinlock_t i_mmap_lock; /* protect tree, count, list */
atomic_t truncate_count; /* Cover race condition with truncate */
+ unsigned long nrpages; /* number of total pages */
+ pgoff_t writeback_index;/* writeback starts here */
+ struct address_space_operations *a_ops; /* methods */
unsigned long flags; /* error bits/gfp mask */
struct backing_dev_info *backing_dev_info; /* device readahead, etc */
spinlock_t private_lock; /* for use by the address_space */
@@ -437,6 +437,7 @@ struct inode {
unsigned long i_version;
unsigned long i_blocks;
unsigned short i_bytes;
+ unsigned char i_sock;
spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
struct semaphore i_sem;
struct rw_semaphore i_alloc_sem;
@@ -456,6 +457,8 @@ struct inode {
struct cdev *i_cdev;
int i_cindex;
+ __u32 i_generation;
+
unsigned long i_dnotify_mask; /* Directory notify events */
struct dnotify_struct *i_dnotify; /* for directory notifications */
@@ -463,11 +466,9 @@ struct inode {
unsigned long dirtied_when; /* jiffies of first dirtying */
unsigned int i_flags;
- unsigned char i_sock;
atomic_t i_writecount;
void *i_security;
- __u32 i_generation;
union {
void *generic_ip;
} u;
_
next reply other threads:[~2004-08-26 4:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-26 4:41 Anton Blanchard [this message]
2004-08-26 4:55 ` [PATCH] reduce size of struct inode on 64bit viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040826044113.GA10843@krispykreme \
--to=anton@samba.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox