From owner-freebsd-questions@freebsd.org Mon Aug 24 13:43:30 2015 Return-Path: Delivered-To: freebsd-questions@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 952DB9C1E1A for ; Mon, 24 Aug 2015 13:43:30 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B3451178 for ; Mon, 24 Aug 2015 13:43:29 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id t7ODhH7o056366; Mon, 24 Aug 2015 23:43:19 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Mon, 24 Aug 2015 23:43:17 +1000 (EST) From: Ian Smith To: Mike Clarke cc: freebsd-questions@freebsd.org Subject: Re: Is it really necessary to run swapoff on shutdown? In-Reply-To: Message-ID: <20150824224559.W53217@sola.nimnet.asn.au> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2015 13:43:30 -0000 In freebsd-questions Digest, Vol 585, Issue 5, Message: 21 On Fri, 21 Aug 2015 11:52:04 +0100 Mike Clarke wrote: > I have two 4GB swap partitions on separate drives on my desktop. By > the time I shut down at the end of the day I usually have about 8% swap > in use. > > At an early stage in the shutdown /etc/rc.d/swaplate runs > and takes about one minute to run '/sbin/swapoff -aq'. On some occasions > when more swap has been used swapoff has failed to complete before > timing out. I guess you could extend the shutdown timeout as a poor workaround? > Perhaps I'm misunderstanding the finer details of managing swap space > but I would have expected that swapoff could be omitted on shutdown. As > each process shuts itself down it will retrieve any swapped out pages > which it needs so by the time the last process is finished none of > the remaining data in the swap space will be required by anything and > can be safely discarded. Sounds good in theory, but dragons may caution 'shoulds' for 'wills' .. > Also if it really is necessary to run swapoff on shutdown should the > command have also included the -L option to allow for it having been > used in the swapon command. I know nothing, except noticing that the recent thread 'Swap Questions' in -stable@ explores some perhaps related issues, including use of '-L' http://lists.freebsd.org/pipermail/freebsd-stable/2015-August/083060.html cheers, Ian