diff options
author | Rafael Aquini | 2013-05-26 06:31:56 +0200 |
---|---|---|
committer | Karel Zak | 2013-08-23 12:50:39 +0200 |
commit | d6387c98cb0e0811aafbfdff09256ce2ff7742e4 (patch) | |
tree | 15a28a2eed87ac8dcf89cfc049fa8269bbc6fc7b /sys-utils/swapon.8 | |
parent | last: mention optional arguments in usage (diff) | |
download | kernel-qcow2-util-linux-d6387c98cb0e0811aafbfdff09256ce2ff7742e4.tar.gz kernel-qcow2-util-linux-d6387c98cb0e0811aafbfdff09256ce2ff7742e4.tar.xz kernel-qcow2-util-linux-d6387c98cb0e0811aafbfdff09256ce2ff7742e4.zip |
swapon: allow a more flexible swap discard policy
Introduce the necessary changes to swapon(8) allowing a sysadmin to leverage
the new changes introduced to sys_swapon by "swap: discard while swapping
only if SWAP_FLAG_DISCARD_PAGES", therefore allowing a more flexible set of
choices when selection the discard policy for mounted swap areas.
This patch introduces the following optional arguments to the already
existent swapon(8) "--discard" option, in order to allow a discard type to
be selected at swapon time:
* once : only single-time area discards are issued. (swapon)
* pages : discard freed pages before they are reused.
If no policy is selected both discard types are enabled. (default)
[kzak@redhat.com: - support <policy> argument for short -d option too,
- add errx() on unsupported policy name]
Signed-off-by: Rafael Aquini <aquini@redhat.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/swapon.8')
-rw-r--r-- | sys-utils/swapon.8 | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/sys-utils/swapon.8 b/sys-utils/swapon.8 index 385bf5aea..836b17277 100644 --- a/sys-utils/swapon.8 +++ b/sys-utils/swapon.8 @@ -112,15 +112,25 @@ All devices marked as ``swap'' in are made available, except for those with the ``noauto'' option. Devices that are already being used as swap are silently skipped. .TP -.B "\-d, \-\-discard" -Discard freed swap pages before they are reused, if the swap -device supports the discard or trim operation. This may improve -performance on some Solid State Devices, but often it does not. +.B "\-d, \-\-discard\fR [=\fIpolicy\fR]" +Enable swap discards, if the swap backing device supports the discard or +trim operation. This may improve performance on some Solid State Devices, +but often it does not. The option allows one to select between two +available swap discard policies: +.BI \-\-discard=once +to perform a single-time discard operation for the whole swap area at swapon; +or +.BI \-\-discard=pages +to discard freed swap pages before they are reused, while swapping. +If no policy is selected, the default behavior is to enable both discard types. The .I /etc/fstab -mount option -.BI discard -may be also used to enable discard flag. +mount options +.BI discard, +.BI discard=once, +or +.BI discard=pages +may be also used to enable discard flags. .TP .B "\-e, \-\-ifexists" Silently skip devices that do not exist. |