Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Feb 2007 11:27:58 +1100
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        freebsd-hackers@freebsd.org
Subject:   Abyssmal dump cache efficiency
Message-ID:  <20070218002758.GQ859@turion.vk2pj.dyndns.org>

next in thread | raw e-mail | index | archive | help

--8nsIa27JVQLqB7/C
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I've been looking into the efficiency of the caching in dump(8) and
it's abyssmal: After instrumenting dump(8) and looking at its access
patterns, it turns out that it typically reads roughly three times as
much data into its cache as it should, whilst using five times as
much RAM as requested.

This poor efficiency is related to the way dump(8) works: A master
process scans through the inodes to dump and a number of slave
processes (three by default) actually read the disk blocks and write
the data to tape.  Additional processes are spawned for each tape
written (to simplify checkpointing).  If dump writes to a single tape,
it will use a total of five processes.  The current cache mechanism
has a separate private cache associated with each process.  Thus you
typically have five caches (each of the requested size).

The re-reading is partially caused by the distribution of read
requests across the slave processes: Read requests for adjacent blocks
of data are likely to be handled by different slave processes and
therefore different caches.

I've checked out the behaviour in the various *BSDs with the following
results:
DragonFly copied FreeBSD
NetBSD uses a single shared cache
OpenBSD doesn't support caching.

I've tried modelling a unified cache along the NetBSD line and there
appears to be a massive improvement in cache performance.  It's unclear
how much of an improvement this will give in overall performance but
not physically reading data from disk must be faster than reading it.

I believe it would be worthwhile creating a todo item to investigate
this more thoroughly.

--=20
Peter Jeremy

--8nsIa27JVQLqB7/C
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)

iD8DBQFF152O/opHv/APuIcRAm22AKC4y1LMm/PShzpKgvTx+s18KqHsNACgr/0L
cUSBNfYBpC+oPqaIMK+2H+4=
=EN4f
-----END PGP SIGNATURE-----

--8nsIa27JVQLqB7/C--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070218002758.GQ859>