Re: Looking at space used by objects in slab allocator

From: Theodore Tso
Date: Tue Feb 13 2007 - 09:24:47 EST


On Mon, Feb 12, 2007 at 01:53:03PM -0500, William Cohen wrote:
> After last week's experiment reducing size of task_struct on I was
> The is a signficant amount of space wasted for ext3_inode_cache. If
> the struct used for ext3_inode_cache struct could be made smaller,
> three objects rather than two could fit in a slab. Fitting 3 objects
> to a page would decrease the space required for ext3_inod_cache from
> 20.4MB to 13.6MB in this example.

The problem is the size of "struct inode" (which is included in struct
ext3_inode_info). There is quite a few fields in struct inode which
are only used when the inode has been opened and being referenced by
one or more file descriptors, but which take up a huge amount of
space. One of the biggies is inode.i_data; struct address_space is
*huge*, and we're keeping a copy of it in every single inode which
we're caching.

It was next on my list on my inode-diet project that I worked on about
six months ago, but it was non-trivial, and my time got sucked away
with other projects, so I never got back to it. But if you want to
try to save space, that's the next logical step --- we've already done
all or most of the low-hanging fruit to save space wasted by struct
inode and by extension in the ext3_inode_cache.

- Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/