Bug 162382 - [swap] Orphaned swap references not garbage collected; renders impossible to remove
Summary: [swap] Orphaned swap references not garbage collected; renders impossible to ...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-08 20:00 UTC by Enji Cooper
Modified: 2017-12-31 22:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2011-11-08 20:00:24 UTC
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").
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:49 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped