Subject: Re: namei caching of newly created files?
To: Bill Studenmund <wrstuden@netbsd.org>
From: Daniel Carosone <dan@geek.com.au>
List: tech-kern
Date: 01/20/2005 14:24:33
--ABASXTTJEiBwKrZs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jan 19, 2005 at 05:47:31PM -0800, Bill Studenmund wrote:
> To further complicate things, we also use that initial search to look for=
=20
> empty entries. If we don't find the name, we will use one empty entry to=
=20
> store the to-be-created inode. So even if we used an in-core tree (or has=
h=20
> table) to tell if the file doesn't exist, we still need to know where to=
=20
> create it in the dir.

This is hurting, mostly, because it's being done over and over again
all the way to the end of the dir. As the simplest possible change,
before looking at more complex solutions, having done the search to
the end once and found no free slots, we could remember that fact.  We
would reset the flag on deleting an entry and making a space, or
perhaps after doing so several times.

With a complete in-core cache (as discussed) of the names, for the
existence test, and this flag set, we just append new entries to the
end of the dir quickly.  That would address the needs of this
benchmark, leaving room for discussion and design of smarter rewrites
or optimisations using some of the other ideas proposed.

--
Dan.


--ABASXTTJEiBwKrZs
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iD8DBQFB7yRxEAVxvV4N66cRAnSMAKCCW9dkTeHJt3ld0fenYf1nZkT9GgCgo3Ng
EyceU36RPunI8wdIBRkp8Ls=
=326Z
-----END PGP SIGNATURE-----

--ABASXTTJEiBwKrZs--