From owner-freebsd-hackers@freebsd.org Mon Nov 28 16:57:24 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DBC4C59575 for ; Mon, 28 Nov 2016 16:57:24 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D03E91249 for ; Mon, 28 Nov 2016 16:57:23 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cBOhU-000B0H-Dv; Mon, 28 Nov 2016 19:22:40 +0300 Date: Mon, 28 Nov 2016 19:22:40 +0300 From: Slawa Olhovchenkov To: Konstantin Belousov Cc: Fabian Keil , freebsd-hackers@freebsd.org, David Cross Subject: Re: FreeBSD 11 i386 disk deadlock (I think) (now with reproduction steps!) Message-ID: <20161128162240.GM99742@zxy.spb.ru> References: <20161128041847.GA65249@charmander> <20161128120046.GP54029@kib.kiev.ua> <20161128144135.10f93205@fabiankeil.de> <20161128160311.GQ54029@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161128160311.GQ54029@kib.kiev.ua> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 16:57:24 -0000 On Mon, Nov 28, 2016 at 06:03:11PM +0200, Konstantin Belousov wrote: > On Mon, Nov 28, 2016 at 02:43:30PM +0100, Fabian Keil wrote: > > David Cross wrote: > > > > > This is certainly new behavior, or a new manifestation. > > > > Recently a couple of uma consumers were changed to share uma zones > > instead of using a dedicated zone. As a result geli competes with > > more uma consumers and is more likely to deadlock. The bug isn't > > new, it's just triggered more often now. > The problem happens on layer much lower than UMA, it is whole reusable > page pool which is depleted and cannot be re-filled without allocating > more memory. If you think about it, the deadlock is obviously trivial: > pagedaemon is the main source of the free pages, but if producing free > page requires allocating one, low memory condition is equal to deadlock. > > It was always there, in the sense that for all versions of freebsd, if > file/disk write path requires memory allocation, there is the trouble. > > For geom, some special unique measures were taken so that bio allocations > do not cause the issue in typical situations. Typical workaround for this is pre-allocate some memory for this operation.