Module name: tmpfs
Committed by: jmmv
Date: Fri Sep 9 16:38:06 UTC 2005
tmpfs/src/sys/fs/tmpfs: tmpfs.h tmpfs_pool.c tmpfs_pool.h
tmpfs_subr.c tmpfs_vfsops.c tmpfs_vnops.c
Implement "string pools" to efficiently allocate variable-sized strings.
The implementation may look a bit clumsy (due to the values hardcoded
in it) but it's fast and works, so I'm not going to think for cleaner
ways (I mean, code that looks excellent to the eyes) to do the same, at
least for a while.
These pools are used to store file names and link targets. As an
empirical result, consider that before this change, a "touch $(jot 10000)"
inside tmpfs consumed up to 20MB, while now hardly passes the 1.5MB mark.
Also note that creating 10000 files with longer names (that surpass the
first allocation block of 16 bytes and enter the 32 bytes barrier) only
consumes 1.7MB, so further optimizations need to be done somewhere else.
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 tmpfs/src/share/man/man9/tmpfs.9
cvs rdiff -u -r1.2 -r1.3 tmpfs/src/sys/fs/tmpfs/tmpfs_pool.h
cvs rdiff -u -r1.3 -r1.4 tmpfs/src/sys/fs/tmpfs/tmpfs_pool.c
cvs rdiff -u -r1.34 -r1.35 tmpfs/src/sys/fs/tmpfs/tmpfs_vfsops.c
cvs rdiff -u -r1.46 -r1.47 tmpfs/src/sys/fs/tmpfs/tmpfs.h
cvs rdiff -u -r1.55 -r1.56 tmpfs/src/sys/fs/tmpfs/tmpfs_subr.c
cvs rdiff -u -r1.64 -r1.65 tmpfs/src/sys/fs/tmpfs/tmpfs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.