From owner-freebsd-bugs@FreeBSD.ORG Tue Nov 8 20:00:24 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBAA41065672 for ; Tue, 8 Nov 2011 20:00:24 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8E0558FC18 for ; Tue, 8 Nov 2011 20:00:24 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8K0Ow5035775 for ; Tue, 8 Nov 2011 20:00:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pA8K0O3R035772; Tue, 8 Nov 2011 20:00:24 GMT (envelope-from gnats) Resent-Date: Tue, 8 Nov 2011 20:00:24 GMT Resent-Message-Id: <201111082000.pA8K0O3R035772@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4198610656F3 for ; Tue, 8 Nov 2011 19:50:51 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 3111B8FC0C for ; Tue, 8 Nov 2011 19:50:51 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8JooIg051420 for ; Tue, 8 Nov 2011 19:50:50 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id pA8JooTh051419; Tue, 8 Nov 2011 19:50:50 GMT (envelope-from nobody) Message-Id: <201111081950.pA8JooTh051419@red.freebsd.org> Date: Tue, 8 Nov 2011 19:50:50 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/162382: Orphaned swap references not garbage collected; renders impossible to remove X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 20:00:24 -0000 >Number: 162382 >Category: kern >Synopsis: Orphaned swap references not garbage collected; renders impossible to remove >Confidential: no >Severity: critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Nov 08 20:00:24 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9.0-RC1 >Organization: iXsystems, Inc. >Environment: FreeBSD bayonetta.local 9.0-RC1 FreeBSD 9.0-RC1 #0: Sat Nov 5 17:19:05 PDT 2011 root@bayonetta.local:/usr/obj/store/freebsd/stable/9/sys/BAYONETTA amd64 >Description: If one sets up multiple swaps that are striped across disks and one goes south, the kernel retains a reference to the lost swap, but unfortunately doesn't remove the phantom reference; furthermore, the user can't remove the phantom reference, because the bogus device doesn't exist. This can cause issues if the swap was being used, either at a kernel or userland level. Eventually [with mps at least] the system gets cranky and kicks the device out of some subsystems, but doesn't get rid of the bogus reference -- thus it could cause serious issues if a process tries to swap back from the phantom swap device. What I'm recommending is that the phantom reference be reaped immediately. This should trickle up through all affected subsystems (GEOM -> vm -> etc). Any processes trying to access memory that was swapped out should be SIGKILLed immediately in a worst case scenario, but other potentially more graceful (or quicker) methods of notifying affected processes could be employed so processes that carve out a large chunk of memory that's gone MIA (SIGABRT? SIGSEGV?). delphij@ might have more details or context into the underlying issue. >How-To-Repeat: 1. Install FreeBSD on a system with an HBA or gmirror that's capable of hotswap and setup the RAID in a redundant manner. 2. Setup swaps on multiple devices in a striped manner. 3. Yank a disk with a swap on it. 4. Look at swapctl -l; you'll see a gobbledygook reference to a dead device (something like "/dev/C@#$A6^7"). >Fix: >Release-Note: >Audit-Trail: >Unformatted: