From owner-freebsd-questions@freebsd.org Sat Oct 13 07:11:34 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9840210B7C84 for ; Sat, 13 Oct 2018 07:11:34 +0000 (UTC) (envelope-from 4250.10.freebsd-questions=freebsd.org@email-od.com) Received: from s1-b0c6.socketlabs.email-od.com (s1-b0c6.socketlabs.email-od.com [142.0.176.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46A068CAB9 for ; Sat, 13 Oct 2018 07:11:34 +0000 (UTC) (envelope-from 4250.10.freebsd-questions=freebsd.org@email-od.com) DKIM-Signature: v=1; a=rsa-sha256; d=email-od.com;i=@email-od.com;s=dkim; c=relaxed/relaxed; q=dns/txt; t=1539414694; x=1542006694; h=content-transfer-encoding:content-type:mime-version:references:in-reply-to:message-id:subject:cc:to:from:date:x-thread-info; bh=0JmGOMs/WdcIzNsyFcrbdZyAw/KpvYfiawWFzfNRveE=; b=c25G9zCeB5MgEkLz/oDdaxciRISPMCUcPUJmtIujFmBNlGGyP/dDca88jzzcFlnzxfN8HWzQsB1rEcMdMYuRANkx5eVlK7Ew63CQVYZzy1QxC/REZEpSGhnnUXtynnGOExfojix+FVutVNslDA5p8IMV7c1uRAJcV1Gpm4TSqoo= X-Thread-Info: NDI1MC4xMi4xOWQwMDAwMDAzNmRkMzguZnJlZWJzZC1xdWVzdGlvbnM9ZnJlZWJzZC5vcmc= Received: from r4.h.in.socketlabs.com (s1-b40f.socketlabs.email-od.com [142.0.180.15]) by mxsg2.email-od.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Sat, 13 Oct 2018 03:11:22 -0400 Received: from smtp.lan.sohara.org (EMTPY [89.127.62.20]) by r4.h.in.socketlabs.com with ESMTP(version=Tls12 cipher=Aes256 bits=256); Sat, 13 Oct 2018 03:11:21 -0400 Received: from [192.168.63.1] (helo=steve.lan.sohara.org) by smtp.lan.sohara.org with smtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1gBE51-00075r-1c; Sat, 13 Oct 2018 08:11:19 +0100 Date: Sat, 13 Oct 2018 08:11:18 +0100 From: Steve O'Hara-Smith To: freebsd-questions@freebsd.org Cc: RW Subject: Re: swap to a sparse file Message-Id: <20181013081118.9e8632405e555c3bf2f9a722@sohara.org> In-Reply-To: <20181012193633.7dc32f86@gumby.homeunix.com> References: <20181011014705.GA17798@admin.sibptus.ru> <20181011085114.bfcdb701b3644728a71eaa38@sohara.org> <20181012193633.7dc32f86@gumby.homeunix.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd11.1) X-Clacks-Overhead: "GNU Terry Pratchett" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Oct 2018 07:11:34 -0000 On Fri, 12 Oct 2018 19:36:33 +0100 RW via freebsd-questions wrote: > On Thu, 11 Oct 2018 08:51:14 +0100 > Steve O'Hara-Smith wrote: > > > On Thu, 11 Oct 2018 08:47:05 +0700 > > Victor Sudakov wrote: > > > > > Is there any good reason I can't just "truncate -s2G /swap0" and > > > make the swap a sparse file? > > > > Just one - if the space isn't there when the system needs it > > there will be a panic. > > Is that really the only reason? I've not paid much attention, but the > warnings I've heard about this have made it sound a lot worse. There's not much worse the system can do than panic, other than deadlock which might happen if memory needs to be allocated in order to add blocks to the file. IIRC swap on a zvol can deadlock that way. -- Steve O'Hara-Smith