public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH 0/8] Inode slimming
@ 2006-06-19 15:20 Theodore Tso
  2006-06-19 15:20 ` [RFC] [PATCH 1/8] inode_diet: Replace inode.u.generic_ip with inode.i_private Theodore Tso
                   ` (8 more replies)
  0 siblings, 9 replies; 46+ messages in thread
From: Theodore Tso @ 2006-06-19 15:20 UTC (permalink / raw)
  To: linux-kernel

The following patches reduce the size of struct inode.  Unfortunately,
since these structures are used by a large amount of kernel code, some
of the patches are quite involved, and/or will require a lot of
auditing and code review, for "only" 4 or 8 bytes at a time (maybe
more on 64-bit platforms).  However, since there are many, many copies
of struct inode all over the kernel, even a small reduction in size
can have a large beneficial result, and as the old Chinese saying
goes, a journey of thousand miles begins with a single step....

What else remains to be done?  There are a large number of fields in
struct inode which are never populated unless the inode is open, and
those should get moved into another structure which is populated only
when needed.  There are a large number of inodes which are read into
memory only because stat(2) was called on them (thanks to things like
color ls, et. al).  

Linus has suggested moving the i_data structure out to a separate
structure, again because there are many inodes which do not have any
pages cached in the page cache.  The challenge with this a huge number
of codepaths assume that i_mapping is always non-NULL.  But, i_data is
*huge* so the benefits of not having it taking up memory would make
this a high-return activity.

Another possibility is moving i_size into the file-specific area of
the union, which would save 8 bytes.  However there are a largish
number block device drivers that seem to have hijacked i_size to store
the blocksize(!?!) of the device, and that should really be done in a
bdev-specific structure.  Untangling this will be somewhat
challenging, but should be doable.

--

^ permalink raw reply	[flat|nested] 46+ messages in thread
* [RFC] [PATCH 0/8] Inode diet v2
@ 2006-06-21 12:51 Theodore Tso
  2006-06-21 12:51 ` [RFC] [PATCH 5/8] inode-diet: Eliminate i_blksize and use a per-superblock default Theodore Tso
  0 siblings, 1 reply; 46+ messages in thread
From: Theodore Tso @ 2006-06-21 12:51 UTC (permalink / raw)
  To: linux-kernel

This is the second versoin of patches to reduce the size of struct
inode.  I've taken into account comments to remove super.st_blksize,
and simply requiring filesystems to override getattr if they care to
use something other than the stock PAGE_CACHE_SIZE for st_blksize
(which should be correct given that most filesystems are using
generic_file_read/write).  

Unfortunately, since these structures are used by a large amount of
kernel code, some of the patches are quite involved, and/or will
require a lot of auditing and code review, for "only" 4 or 8 bytes at
a time (maybe more on 64-bit platforms).  However, since there are
many, many copies of struct inode all over the kernel, even a small
reduction in size can have a large beneficial result, and as the old
Chinese saying goes, a journey of thousand miles begins with a single
step....

What else remains to be done?  There are a large number of fields in
struct inode which are never populated unless the inode is open, and
those should get moved into another structure which is populated only
when needed.  There are a large number of inodes which are read into
memory only because stat(2) was called on them (thanks to things like
color ls, et. al).  

Linus has suggested moving the i_data structure out to a separate
structure, again because there are many inodes which do not have any
pages cached in the page cache.  The challenge with this a huge number
of codepaths assume that i_mapping is always non-NULL.  But, i_data is
*huge* so the benefits of not having it taking up memory would make
this a high-return activity.

Another possibility is moving i_size into the file-specific area of
the union, which would save 8 bytes.  However there are a largish
number block device drivers that seem to have hijacked i_size to store
the blocksize(!?!) of the device, and that should really be done in a
bdev-specific structure.  Untangling this will be somewhat
challenging, but should be doable.

--

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2006-06-22  9:03 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-19 15:20 [RFC] [PATCH 0/8] Inode slimming Theodore Tso
2006-06-19 15:20 ` [RFC] [PATCH 1/8] inode_diet: Replace inode.u.generic_ip with inode.i_private Theodore Tso
2006-06-19 17:17   ` Jan Engelhardt
2006-06-19 19:09   ` Christoph Hellwig
2006-06-19 19:37     ` Theodore Tso
2006-06-20  9:43   ` Steven Whitehouse
2006-06-20 11:45     ` Arnd Bergmann
2006-06-20 12:34       ` Steven Whitehouse
2006-06-20 13:53         ` Arnd Bergmann
2006-06-20 15:01           ` Brian F. G. Bidulock
2006-06-20 15:04             ` Brian F. G. Bidulock
2006-06-20 12:29     ` Theodore Tso
2006-06-19 15:20 ` [RFC] [PATCH 2/8] inode-diet: Move i_pipe into a union Theodore Tso
2006-06-19 17:19   ` Jan Engelhardt
2006-06-19 19:06     ` Theodore Tso
2006-06-20 15:23       ` Brian F. G. Bidulock
2006-06-21  1:45         ` Theodore Tso
2006-06-22  9:03           ` Brian F. G. Bidulock
2006-06-19 15:20 ` [RFC] [PATCH 3/8] inode-diet: Move i_bdev " Theodore Tso
2006-06-19 15:20 ` [RFC] [PATCH 4/8] inode-diet: Move i_cdev " Theodore Tso
2006-06-19 17:20   ` Jan Engelhardt
2006-06-19 15:20 ` [RFC] [PATCH 5/8] inode-diet: Eliminate i_blksize and use a per-superblock default Theodore Tso
2006-06-19 15:49   ` Avi Kivity
2006-06-19 16:55     ` Theodore Tso
2006-06-19 15:58   ` Christoph Hellwig
2006-06-19 16:16     ` Joel Becker
2006-06-19 17:20       ` Theodore Tso
2006-06-19 18:55         ` Christoph Hellwig
2006-06-19 22:13           ` Mark Fasheh
2006-06-21 19:41         ` Nate Diller
2006-06-19 17:03     ` Theodore Tso
2006-06-19 18:56       ` Christoph Hellwig
2006-06-19 16:01   ` Joel Becker
2006-06-19 17:06     ` Theodore Tso
2006-06-19 21:45       ` Joel Becker
2006-06-19 22:14       ` Mark Fasheh
2006-06-19 15:20 ` [RFC] [PATCH 6/8] inode-diet: Move i_cindex from struct inode to struct file Theodore Tso
2006-06-19 19:33   ` Al Viro
2006-06-19 19:37     ` Al Viro
2006-06-19 20:58       ` Theodore Tso
2006-06-19 21:51         ` Stefan Richter
2006-06-19 15:20 ` [RFC] [PATCH 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices Theodore Tso
2006-06-19 15:20 ` [RFC] [PATCH 8/8] inode-diet: Fix size of i_blkbits, i_version, and i_dnotify_mask Theodore Tso
2006-06-19 16:54 ` [RFC] [PATCH 0/8] Inode slimming Christoph Lameter
2006-06-19 19:09   ` Theodore Tso
  -- strict thread matches above, loose matches on Subject: below --
2006-06-21 12:51 [RFC] [PATCH 0/8] Inode diet v2 Theodore Tso
2006-06-21 12:51 ` [RFC] [PATCH 5/8] inode-diet: Eliminate i_blksize and use a per-superblock default Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox