Page MenuHomeFreeBSD

Eliminate incorrect 2 pagesized block skipping while preparing swap device.
Needs ReviewPublic

Authored by on Jun 17 2019, 7:24 PM.



When a FreeBSD partition is passed, like /dev/ada0s1b, we are okay.

According to the comment, it looks like the code was to skip BSD label to prevent damages when a FreBSD slice, like dev/ada0s1, is passed. If that' done, swapping out will destroy FreeBSD partitions sooner or later anyway, skipping 8-k doesn't help much.

It looks this 2-page offset is passed incorrectly to some of blist() and/or page-in actions and results in system hung.

One can reproduce with with more than 2 swap devices easily. Fill out one swap device and "swapoff" filled one hangs forever. This can happen with a single swap device; however, if a single swap device is fully used,
the system is under slashing condition and it is very difficult to distinguish
between slashing and hanging/not-responding.

I replaced to use sw_nblks in some places to be explicit although nblks and sw_nblks are the same in most places.

Test Plan

Still testing to see if this completely eleminates swapoff(1) and page-in hungs.
D20674 fix helps to monitor greately with "systat -vm."

Diff Detail

rS FreeBSD src repository
Lint OK
No Unit Test Coverage
Build Status
Buildable 24903
Build 23633: arc lint + arc unit

Event Timeline edited the summary of this revision. (Show Details)Jun 17 2019, 7:27 PM added a reviewer: dougm.
dougm added a reviewer: alc.Jun 17 2019, 8:48 PM
dougm added a comment.Jun 18 2019, 3:27 AM

Most of these changes are distractions, unrelated to your real purpose. I suggest you get rid of them. What's left is you removing a bug fix from 2003 without any explanation about why that fix is no longer necessary, and you fixing a bug that hasn't been filed with no real explanation of how it is a fix. I don't think anyone has enough information to approve this change.