]> git.ipfire.org Git - thirdparty/util-linux.git/commit
swapon: fix discard=pages docs
authorRichard Yao <ryao@gentoo.org>
Fri, 11 Mar 2016 22:03:27 +0000 (17:03 -0500)
committerKarel Zak <kzak@redhat.com>
Mon, 14 Mar 2016 11:26:28 +0000 (12:26 +0100)
commit1d01d13edaa0ee52ac5a6da5a0822377b43483da
tree471cd7d5bb4a65cf15c8ab874bdba72d8603f899
parent8c97556ecfc0af358d35dc7a842aaadde5eeafd3
swapon: fix discard=pages docs

The documentation for discard=pages is ambiguous in that it could be
interpreted to mean either that the pages are discarded immediately
after being freed or that the pages are discarded immediately before
being reused by a write. Both implementations would satisfy the
statement "discard freed swap pages before they are avaliable for
reuse", but the kernel does the former.

Doing a discard operation (which is non-queued on SATA drives before
SATA 3.1) before a write operation to the same sector is pointless
unless using, pre-SATA 3.1 drives, where discard is detrimental because
ATA TRIM is a non-queued command.

Anyone who wants discard operations on swap and interprets the man page
as describing the incorrect behavior would opt for discard=once over
discard, when discard provides the behavior of both discard=once and
discard=pages, which is what they likely want.

Lets make a small change to the documentation to clarify the behavior.

Signed-off-by: Richard Yao <ryao@gentoo.org>
sys-utils/swapon.8