]> git.hungrycats.org Git - linux/commit
[PATCH] dentry qstr consolidation
authorAndrew Morton <akpm@osdl.org>
Fri, 14 May 2004 12:46:55 +0000 (05:46 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 14 May 2004 12:46:55 +0000 (05:46 -0700)
commit90b163a4b5dd909f8a6f9c61c5bdce17130350a0
treec1acb644b3cd9fecd1cf9d97f2e04c65ee395674
parentfd2d876083bf90ce4f569542d78166387937e0bf
[PATCH] dentry qstr consolidation

When dentries are given an external name we currently allocate an entire qstr
for the external name.

This isn't needed.  We can use the internal qstr and kmalloc only the string
itself.  This saves 12 bytes from externally-allocated names and 4 bytes from
the dentry itself.

The saving of 4 bytes from the dentry doesn't actually decrease the dentry's
storage requirements, but it makes four more bytes available for internal
names, taking the internal/external ratio from 89% up to 93% on my 1.5M files.

Fix:

The qstr consolidation wasn't quite right, because it can cause qstr->len to
be unstable during lookup lockless traverasl.

Fix that up by taking d_lock earlier in lookup.  This serialises against
d_move.

Take the lock after comparing the parent and hash to preserve the
mostly-lockless behaviour.

This obsoletes d_movecount, which is removed.
fs/dcache.c
include/linux/dcache.h