★ wanayoo — archive 1999 http://www.kernelnotes.org/patch/21-p0730.htmlNouvelle recherche | Portail wanayoo

dcache slab allocator patch

Kevin Buhr (buhr@stat.wisc.edu)
Wed Aug 6 21:59:00 1997

[Home] [Linux 2.0] [Linux 2.1] [Information] [Software] [Distributions] [Links]

21-dname-32.patch
Dean Gaudet  writes:
>
> filenames probably display a regularity that you can exploit ... such as a
> mode around 7 or 8 chars.  I'm assuming the dcache has just the basename
> for each entry rather than the full name ... but I've never looked at the
> code.  You could create a slab for the 1 .. 8 char names, and then another
> for the 9 .. 16, and then just kmalloc the rest.  Those numbers would have
> to be verified by experimentation.

Yup, it's just the basename, and your scheme is right on the money.

In fact, right now the smallest size "kmalloc" objects are 32 bytes, so even by introducing a "dname-16" cache (for filenames 1..15 characters in length), I think we make a big win.

I've just slapped together a patch along these lines (with a dname-16, dname-32, and dname-64 cache), and it seems to be working fine. However, it needs some testing with regards to filenames longer than 64 characters (and the renaming to and from all combinations of short and long filenames). I also haven't checked if some naughty bit of filesystem code outside of "dcache.c" tries allocating or freeing dnames the "old" way.

Anyway, I've enclosed the patch against 2.1.47; enjoy, but use at your own risk.




[Home] [Up] [Search] [FeedBack]

Copyleft © The LinuxHQ Project. Licensed under the GNU Public License.