public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC] [PATCH 0/8] Inode diet v2
Date: Wed, 21 Jun 2006 12:48:23 -0400	[thread overview]
Message-ID: <20060621164823.GB28159@thunk.org> (raw)
In-Reply-To: <20060621084217.B7834@openss7.org>

On Wed, Jun 21, 2006 at 08:42:17AM -0600, Brian F. G. Bidulock wrote:
> > 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....
> 
> Can you grep inode_cache /proc/slabinfo to see whether you saved any
> memory at all?

I've been doing this continuously as I do my patches, and, yes, we're
definitely saving memory.  How much memory depends on the
configuration.  In particular, some people may not realize how much
memory CONFIG_DEBUG_SPINLOCK, CONFIG_DEBUG_MUTEXES, et. al. consume.
They can make the difference between 300-odd bytes and 500-odd bytes
for the base struct inode.

Also, struct inode is part of a number of different
filesystem-specific inodes, so as we gradually slim down the inode, we
can sometimes win with one filsystem more than others.

But just so people can see the results, here they are on a UML system:

                      BEFORE         AFTER 
name               size obj/slab  size obj/slab 
isofs_inode_cache   308   13	   280   14	 
fat_inode_cache     332   12	   304   13	 
ext2_inode_cache    388   10	   360   11	 
ext3_inode_cache    424    9	   396   10	 
reiser_inode_cache  356   11	   328   12	 
shmem_inode_cache   372   10	   344   11	 
proc_inode_cache    296   13	   268   14	 
inode_cache         280   14	   252   15     

By going from 280 to 252 bytes, we've achieved a net savings of 10% on
struct inode, which is definitely not bad.  Is there more work to be
done?  Sure.  But we need to take the first step.

						- Ted


      parent reply	other threads:[~2006-06-21 16:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 12:51 [RFC] [PATCH 0/8] Inode diet v2 Theodore Tso
2006-06-21 12:51 ` [RFC] [PATCH 1/8] inode_diet: Replace inode.u.generic_ip with inode.i_private Theodore Tso
2006-06-21 13:23   ` Jan Engelhardt
2006-06-21 14:44   ` Brian F. G. Bidulock
2006-06-21 15:37     ` Theodore Tso
2006-06-21 12:51 ` [RFC] [PATCH 2/8] inode-diet: Move i_pipe into a union Theodore Tso
2006-06-21 12:51 ` [RFC] [PATCH 3/8] inode-diet: Move i_bdev " Theodore Tso
2006-06-21 12:51 ` [RFC] [PATCH 4/8] inode-diet: Move i_cdev " Theodore Tso
2006-06-21 12:51 ` [RFC] [PATCH 5/8] inode-diet: Eliminate i_blksize and use a per-superblock default Theodore Tso
2006-06-21 12:51 ` [RFC] [PATCH 6/8] inode-diet: Move i_cindex from struct inode to struct file Theodore Tso
2006-06-21 12:51 ` [RFC] [PATCH 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices Theodore Tso
2006-06-21 12:51 ` [RFC] [PATCH 8/8] inode-diet: Fix size of i_blkbits, i_version, and i_dnotify_mask Theodore Tso
     [not found]   ` <200606212335.00176.arnd@arndb.de>
2006-06-22  3:11     ` Theodore Tso
2006-06-21 14:42 ` [RFC] [PATCH 0/8] Inode diet v2 Brian F. G. Bidulock
2006-06-21 15:31   ` Nick Piggin
2006-06-21 16:06   ` Arjan van de Ven
2006-06-21 16:12     ` Brian F. G. Bidulock
2006-06-21 16:48   ` Theodore Tso [this message]

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=20060621164823.GB28159@thunk.org \
    --to=tytso@mit.edu \
    --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