Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2012 07:02:58 +1100
From:      Peter Jeremy <peterjeremy@acm.org>
To:        Gary Palmer <gpalmer@freebsd.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: disk devices speed is ugly
Message-ID:  <20120214200258.GA29641@server.vk2pj.dyndns.org>
In-Reply-To: <20120213132821.GA78733@in-addr.com>
References:  <4F215A99.8020003@os2.kiev.ua> <4F27C04F.7020400@omnilan.de> <4F27C7C7.3060807@os2.kiev.ua> <CAJ-VmomezUWrEgxxmUEOhWnmLDohMAWRpSXmTR=n2y_LuizKJg@mail.gmail.com> <4F37F81E.7070100@os2.kiev.ua> <CAJ-Vmok9Ph1sgFCy6kNT4XR14grTLvG9M3JvT9eVBRjgqD%2BY9g@mail.gmail.com> <4F38AF69.6010506@os2.kiev.ua> <20120213132821.GA78733@in-addr.com>

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

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

On 2012-Feb-13 08:28:21 -0500, Gary Palmer <gpalmer@freebsd.org> wrote:
>The filesystem is the *BEST* place to do caching.  It knows what metadata
>is most effective to cache and what other data (e.g. file contents) doesn't
>need to be cached.

Agreed.

>  Any attempt to do this in layers between the FS and
>the disk won't achieve the same gains as a properly written filesystem.=20

Agreed - but traditionally, Unix uses this approach via block devices.
For various reasons, FreeBSD moved caching into UFS and removed block
devices.  Unfortunately, this means that any FS that wants caching has
to implement its own - and currently only UFS & ZFS do.

What would be nice is a generic caching subsystem that any FS can use
- similar to the old block devices but with hooks to allow the FS to
request read-ahead, advise of unwanted blocks and ability to flush
dirty blocks in a requested order with the equivalent of barriers
(request Y will not occur until preceeding request X has been
committed to stable media).  This would allow filesystems to regain
the benefits of block devices with minimal effort and then improve
performance & cache efficiency with additional work.

One downside of the "each FS does its own caching" in that the caches
are all separate and need careful integration into the VM subsystem to
prevent starvation (eg past problems with UFS starving ZFS L2ARC).

--=20
Peter Jeremy

--VbJkn9YxBvnuCH5J
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (FreeBSD)

iEYEARECAAYFAk86vfIACgkQ/opHv/APuIdhKwCfaIq3Q2Xfl2l+4Qknp1n4f2yW
WHgAn1pewFdOWd0/XLeEDKT27rVux2Ab
=yehn
-----END PGP SIGNATURE-----

--VbJkn9YxBvnuCH5J--



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