From owner-freebsd-questions@freebsd.org Fri Aug 21 10:52:15 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 D80FF9BC723 for ; Fri, 21 Aug 2015 10:52:15 +0000 (UTC) (envelope-from jmc-freebsd2@milibyte.co.uk) Received: from avasout07.plus.net (avasout07.plus.net [84.93.230.235]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D43CF2B for ; Fri, 21 Aug 2015 10:52:14 +0000 (UTC) (envelope-from jmc-freebsd2@milibyte.co.uk) Received: from curlew.milibyte.co.uk ([80.229.31.82]) by avasout07 with smtp id 7Ns51r0011mJoLY01Ns6h3; Fri, 21 Aug 2015 11:52:06 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=JN/GyJ+b c=1 sm=1 tr=0 a=cd0K7rcWwnZFf6xQxRobyA==:117 a=cd0K7rcWwnZFf6xQxRobyA==:17 a=D7rCoLxHAAAA:8 a=0Bzu9jTXAAAA:8 a=kj9zAlcOel0A:10 a=uRRa74qj2VoA:10 a=VrO9JtvGkxOJ1SH3inoA:9 a=CjuIK1q_8ugA:10 Received: from curlew.lan ([192.168.1.13]) by curlew.milibyte.co.uk with esmtp (Exim 4.86) (envelope-from ) id 1ZSjvY-0000Xs-DE for freebsd-questions@freebsd.org; Fri, 21 Aug 2015 11:52:04 +0100 Date: Fri, 21 Aug 2015 11:52:04 +0100 From: Mike Clarke To: freebsd-questions@freebsd.org Message-ID: <20150821115204.39dd7ace@curlew.lan> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; amd64-portbld-freebsd10.1) MIME-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.1.13 X-SA-Exim-Mail-From: jmc-freebsd2@milibyte.co.uk X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on curlew.lan X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Subject: Is it really necessary to run swapoff on shutdown? Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on curlew.milibyte.co.uk) 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: Fri, 21 Aug 2015 10:52:15 -0000 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. 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. 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. -- Mike Clarke