Re: discard change to swapon(2) and swapon(8)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hugh,

On Wed, Nov 10, 2010 at 7:54 AM, Hugh Dickins <hughd@xxxxxxxxxx> wrote:
> On Thu, 4 Nov 2010, Michael Kerrisk wrote:
>>
>> Hugh, would you write a patch for the man-page? Or just supply me with
>> the raw text that should be added to the man page?
>
> Here we go, Michael.  Sorry to be so lame, but I'm not used to patching
> man pages, so I'll probably waste less of your time if I just supply the
> raw text, and let you do the italicizing and emboldening etc - thanks.

No problem. That works for me.

I applied the patch below for man-pages-3.32. Thanks for the help!

Cheers,

Michael


--- a/man2/swapon.2
+++ b/man2/swapon.2
@@ -34,7 +34,7 @@
 .\" 2007-06-22 Ivana Varekova <varekova@xxxxxxxxxx>, mtk
 .\"     Update text describing limit on number of swap files.
 .\"
-.TH SWAPON 2 2010-06-15 "Linux" "Linux Programmer's Manual"
+.TH SWAPON 2 2010-11-15 "Linux" "Linux Programmer's Manual"
 .SH NAME
 swapon, swapoff \- start/stop swapping to file/device
 .SH SYNOPSIS
@@ -55,15 +55,12 @@ sets the swap area to the file or block device specified by
 stops swapping to the file or block device specified by
 .IR path .
 .PP
+If the
+.B SWAP_FLAG_PREFER
+flag is specified in the
 .BR swapon ()
-takes a
-.I swapflags
-argument.
-If
 .I swapflags
-has the
-.B SWAP_FLAG_PREFER
-bit turned on, the new swap area will have a higher priority than default.
+argument, the new swap area will have a higher priority than default.
 The priority is encoded within
 .I swapflags
 as:
@@ -72,6 +69,17 @@ as:
 .I "    (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK"
 .br
 .PP
+If the
+.B SWAP_FLAG_DISCARD
+flag is specified in the
+.BR swapon ()
+.I swapflags
+argumument, freed swap pages will be discarded 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.)
+See also NOTES.
+.PP
 These functions may only be used by a privileged process (one having the
 .B CAP_SYS_ADMIN
 capability).
@@ -169,6 +177,17 @@ Since kernel 2.6.32, the limit is further decreased by 1
 if the kernel is built with the
 .B CONFIG_MEMORY_FAILURE
 option.
+
+Discard of swap pages was introduced in kernel 2.6.29,
+then made conditional
+on the
+.B SWAP_FLAG_DISCARD
+flag in kernel 2.6.36,
+.\" To be precise: 2.6.35.5
+which still discards the
+entire swap area when
+.BR swapon ()
+is called, even if that flag bit is not set.
 .SH "SEE ALSO"
 .BR mkswap (8),
 .BR swapoff (8),

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux