Date: Tue, 8 Nov 2011 19:50:50 GMT From: Garrett Cooper <yanegomi@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/162382: Orphaned swap references not garbage collected; renders impossible to remove Message-ID: <201111081950.pA8JooTh051419@red.freebsd.org> Resent-Message-ID: <201111082000.pA8K0O3R035772@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111081950.pA8JooTh051419>