Re: dentry bloat.

From: viro
Date: Sat May 08 2004 - 05:29:21 EST


On Sat, May 08, 2004 at 03:11:59AM -0700, Andrew Morton wrote:
> Andrew Morton <akpm@xxxxxxxx> wrote:
> >
> > Here be another patch.
>
>
> Can't help myself!
>
>
> - d_vfs_flags can be removed - just use d_flags. It looks like someone
> added d_vfs_flags with the intent of doing bitops on it, but all
> modifications are under dcache_lock. 4 bytes saved.

Bzzert. ->d_vfs_flags modifications are under dcache_lock; ->d_flags ones
are *not* - they are up to whatever filesystem code happens to use them.

> - Pack things so that dentry.d_name.len and dentry.d_flags occupy the same
> word. 4 bytes saved.

d_name.len is accessed on very hot paths. In particular, we are looking
at it while traversing hash chains and we do that without dcache_lock
(see callers of ->d_compare()).

If we are going to hold dcache_lock in __d_lookup(), we can get rid of
a _lot_ more than 2 bytes. 32 bytes that came from RCU are there pretty
much for a single reason - to avoid dcache_lock on that path.
-
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/