From owner-freebsd-current@FreeBSD.ORG Mon Mar 4 05:35:54 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 78B4CB30; Mon, 4 Mar 2013 05:35:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id C6F80D19; Mon, 4 Mar 2013 05:35:53 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r245Znv8090459; Mon, 4 Mar 2013 07:35:49 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.0 kib.kiev.ua r245Znv8090459 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r245Zl0W090457; Mon, 4 Mar 2013 07:35:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 4 Mar 2013 07:35:47 +0200 From: Konstantin Belousov To: Don Lewis Subject: Re: access to hard drives is "blocked" by writes to a flash drive Message-ID: <20130304053547.GY2930@kib.kiev.ua> References: <52867.1362317749@critter.freebsd.dk> <201303040301.r2431Rjm008175@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="L4xCDQ7GT+ph8Lmk" Content-Disposition: inline In-Reply-To: <201303040301.r2431Rjm008175@gw.catspoiler.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: deeptech71@gmail.com, phk@phk.freebsd.dk, freebsd-current@FreeBSD.org, peter@rulingia.com, ian@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 05:35:54 -0000 --L4xCDQ7GT+ph8Lmk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 03, 2013 at 07:01:27PM -0800, Don Lewis wrote: > On 3 Mar, Poul-Henning Kamp wrote: >=20 > > For various reasons (see: Lemming-syncer) FreeBSD will block all I/O > > traffic to other disks too, when these pileups gets too bad. >=20 > The Lemming-syncer problem should have mostly been fixed by 231160 in > head (231952 in stable/9 and 231967 in stable/8) a little over a year > ago. The exceptions are atime updates, mmaped files with dirty pages, > and quotas. Under certain workloads I still notice periodic bursts of > seek noise. After thinking about it for a bit, I suspect that it could > be atime updates, but I haven't tried to confirm that. I never got a definition what a Lemming syncer term means. The (current) syncer model is to iterate over the list of the active vnodes, i.e. vnodes for which an open file exists, or a mapping is established, and initiate the neccessary writes. The iterations over the active list is performed several times during the same sync run over the filesystem, this is considered acceptable. (Mostly) independently, the syncer thread iterates over the list of the dirty buffers and writes them. The "wdrain" wait is independend from the syncer model used. It is entered by a thread which intends to write in some future, but the wait is performed before the entry into VFS is performed, in particular, before any VFS resources are acquired. The wait sleeps when the total amount of the buffer space for which the writes are active (runningbufspace counter) exceeds the hirunningbufspace threshold. This way buffer cache tries to avoid creating too long queue of the write requests. If there is some device which has high latency with the write completion, then it is easy to see that, for the load which creates intensive queue of writes to the said device, regardless of amount of writes to other devices, runningbufspace quickly gets populated with the buffers targeted to the slow device. Then, the "wdrain" wait mechanism kicks in, slowing all writers until the queue is processed. It could be argued that the current typical value of 16MB for the hirunningbufspace is too low, but experiments with increasing it did not provided any measureable change in the throughput or latency for some loads. And, just to wrestle with the misinformation, the unmapped buffer work has nothing to do with either syncer or runningbufspace. >=20 > When using TCQ or NCQ, perhaps we should limit the number of outstanding > writes per device to leave some slots open for reads. We should > probably also prioritize reads over writes unless we are under memory > pressure. Reads are allowed to start even when the runningbufspace is overflown. --L4xCDQ7GT+ph8Lmk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRNDKyAAoJEJDCuSvBvK1BWqwQAJF7jUjb3dPjdxakgYS1fm2y Zx4KsWcq7+UOx6HYrmNms5NBXD/zpj/o4wFQrZ3R0UJBhAlmNJkdvXP149TnNRjc ufb6aLKQU+UikcKK1gExJ96R3/JiBPRYcvCcSRWEcp+F8Q2cRzHDh+g8FdJGCE7l J6+skc4GfacEzzIthzBJTHPq/AfdPzxNcr5zktPJskNvi9E6EJsw07AeWF3nB0so eysCKcYxJYxrFkQHuzAaEIvUlUtuUlioK9Xhj5fAOsbtV/3pua0q7cdQq4jcm8hT 1hcY1eXl3D+PloPoaTz4GVqNUn5LQ0a4YR05HGx7zF6dHQVm0JomdvOAIApqSpDP G7XFHhz7nV3KNPdFfaNuXrfeOY7HMGy8jZpq+WGmltnfR8KxjcwtgMJuRuR7yGdq WPscdno8YD9AP3JoAKQvy0Z6LM65ygitEA8zB+R+iVLFA3P6LAhYMLRhFjBHGobL A36EF1O/C55pv9X3bj6XK2jf/HjJHMAmrmTsxEgGcLlBNLO+EgLZYWgIjj8qGWoT 38evTjYethL3dQj8KN66Xw+OBVQMJXKSCV0vv7eOHMbLpcGk5hSRJd/EASyOAYYr XzFR2MsApAd7x/Hx4cGBXXQLyfyIZ0S6qbwXibDdYb6423cwp+68xbOaJqJsJABq KrZQpWI3jGvX0cyqI6nT =1C5w -----END PGP SIGNATURE----- --L4xCDQ7GT+ph8Lmk--