From owner-freebsd-hackers@freebsd.org Thu Mar 23 03:41:40 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 37AD7D1975B for ; Thu, 23 Mar 2017 03:41:40 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-178.reflexion.net [208.70.211.178]) (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 DE4FC15F9 for ; Thu, 23 Mar 2017 03:41:39 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 31842 invoked from network); 23 Mar 2017 03:41:32 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 23 Mar 2017 03:41:32 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.30.2) with SMTP; Wed, 22 Mar 2017 23:41:32 -0400 (EDT) Received: (qmail 28816 invoked from network); 23 Mar 2017 03:41:31 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 23 Mar 2017 03:41:31 -0000 Received: from [192.168.1.111] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 41926EC7B14 for ; Wed, 22 Mar 2017 20:41:31 -0700 (PDT) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: Leak in file backed swap Message-Id: Date: Wed, 22 Mar 2017 20:41:29 -0700 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.3259) 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: Thu, 23 Mar 2017 03:41:40 -0000 Giulio Ferro auryn at zirakzigil.org wrote on Thu Feb 2 15:05:11 UTC 2017 of problems with a file system based swap space (a swap file). FYI: See Bugzilla 206048 and its Comment #7 in particular, that quotes Konstantin Belousov from an arm list submittal. (Repeated later below.) Many folks in many environments have observed lock ups for files used as swap space, UFS files included (without any ZFS present). Comment #3 from Tom Vijlbrief reported: stress -d 2 -m 3 --vm-keep or the like will hang up. (He listed a 1 GByte RAM and 1 GByte swapfile as an example context for hanging during linking of the kernel.) 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. === Mark Millard markmi at dsl-only.net