From owner-freebsd-hackers@freebsd.org Wed Aug 9 14:13:57 2017 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 59287DCE1E5 for ; Wed, 9 Aug 2017 14:13:57 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-90.reflexion.net [208.70.210.90]) (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 EBB1173CA1 for ; Wed, 9 Aug 2017 14:13:56 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 19192 invoked from network); 9 Aug 2017 14:18:48 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 9 Aug 2017 14:18:48 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.2) with SMTP; Wed, 09 Aug 2017 10:13:55 -0400 (EDT) Received: (qmail 9053 invoked from network); 9 Aug 2017 14:13:55 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 9 Aug 2017 14:13:55 -0000 Received: from [192.168.1.26] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 7FD42EC8559; Wed, 9 Aug 2017 07:13:54 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Freebsd 11.0 - system freeze on intensive I/O From: Mark Millard In-Reply-To: Date: Wed, 9 Aug 2017 07:13:53 -0700 Cc: freebsd-hackers , Eugene Grosbein , Gautam Content-Transfer-Encoding: quoted-printable Message-Id: References: <598ADB65.8060701@grosbein.net> To: Gleb Popov <6yearold@gmail.com> X-Mailer: Apple Mail (2.3273) 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: Wed, 09 Aug 2017 14:13:57 -0000 On 2017-Aug-9, at 6:45 AM, Gleb Popov <6yearold at gmail.com> wrote: > On Wed, Aug 9, 2017 at 12:52 PM, Eugene Grosbein wrote: >=20 >> 09.08.2017 14:11, Gautam =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>> Hi, >>>=20 >>> I raised this topic on freebsd-questions where I suspect a bug = caused due >>> to swapfile usage on FreeBSD. >>>=20 >>> You could read details in the below thread, but summary is that with >> using >>> a swapfile (not a swap partition) the system freezes on some single >> process >>> intensive I/O. This is 100% reproducible. >>>=20 >>> http://marc.info/?l=3Dfreebsd-questions&m=3D150088763825675&w=3D2 >>>=20 >>> I raised a PR - 220971 ; but there are no backtraces / logs etc. = that >> could >>> possibly help. >>>=20 >>> I would like to help narrow this down, but do not know how. Any >> suggestions >>> on how to debug a system freeze and what I need to do ? I could then = try >> to >>> reproduce this and collect the needed information - traces etc. >>=20 >> Swapfile is definitely broken in supported FreeBSD releases, it hangs = the >> system. >> The only known workaround (to me) is not using it. >=20 > I'm using swap on ZFS, and still see the problem, so this might not be = tied > to swapfile. Swap files on ZFS are also known to have the problem. Quoting bugzilla 206048's comment #7 (which is quoting an older list message): On 2017-Feb-13, at 7:20 PM, Konstantin Belousov = wrote on the freebsd-arm list: . . . swapfile write requires the write request to come through the filesystem write path, which might require the filesystem to allocate more memory and read some data. E.g. it is known that any ZFS write request allocates memory, and that write request on large UFS file might require allocating and reading an indirect block buffer to find the block number of the written block, if the indirect block was not yet read. As result, swapfile swapping is more prone to the trivial and = unavoidable deadlocks where the pagedaemon thread, which produces free memory, needs more free memory to make a progress. Swap write on the raw partition = over simple partitioning scheme directly over HBA are usually safe, while = e.g. zfs over geli over umass is the worst construction. =3D=3D=3D Mark Millard markmi at dsl-only.net