From owner-freebsd-questions@FreeBSD.ORG Tue May 29 15:54:29 2012 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC94A106566B for ; Tue, 29 May 2012 15:54:29 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4088FC08 for ; Tue, 29 May 2012 15:54:29 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q4TFsSKM061563 for ; Tue, 29 May 2012 09:54:28 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q4TFsSeD061560 for ; Tue, 29 May 2012 09:54:28 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Tue, 29 May 2012 09:54:28 -0600 (MDT) From: Warren Block To: questions@freebsd.org Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Tue, 29 May 2012 09:54:28 -0600 (MDT) Cc: Subject: Swap files and panics X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 May 2012 15:54:29 -0000 Recently I rearranged partitions on an SSD. The swap partition was eliminated in favor of a swap file on /usr. This works, allows TRIM support on the swap space, and is easier to resize than a partition. However, sometimes the system panics on shutdown. It happens after "syncing disks", so the filesystems are fine, but it's disconcerting. I suspect but haven't yet managed to prove that it's only when swap is not empty. A race condition involving when the filesystems are unmounted? Or should there be some code in /etc/rc.d/addswap to run swapoff before shutdown? This is on a very recent 9-STABLE amd64, i5 2500K. rc.conf: swapfile="/usr/swap/swap"