2017-10-29 22:09:54 +00:00
|
|
|
.TH SWAP 3
|
|
|
|
.SH NAME
|
2017-10-30 00:55:58 +00:00
|
|
|
swap \- memory usage statistics and swap file control
|
2017-10-29 22:09:54 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B bind -a #¶ /dev
|
|
|
|
|
|
|
|
.B /dev/swap
|
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
The
|
|
|
|
.B swap
|
|
|
|
device holds a text block giving memory usage statistics:
|
|
|
|
.IP
|
|
|
|
.EX
|
|
|
|
\fIn\fP memory
|
|
|
|
\fIn\fP pagesize
|
|
|
|
\fIn\fP kernel
|
|
|
|
\fIn\fP/\fIm\fP user
|
|
|
|
\fIn\fP/\fIm\fP swap
|
|
|
|
\fIa\fP/\fIn\fP/\fIm\fP kernel malloc
|
|
|
|
\fIa\fP/\fIn\fP/\fIm\fP kernel draw
|
2017-10-30 00:55:58 +00:00
|
|
|
\fIa\fP/\fIn\fP/\fIm\fP kernel secret
|
2017-10-29 22:09:54 +00:00
|
|
|
.EE
|
|
|
|
.PP
|
|
|
|
These are total memory (bytes), system page size (bytes),
|
|
|
|
kernel memory (pages), user memory (pages), swap space (pages),
|
2017-10-30 00:55:58 +00:00
|
|
|
kernel malloced data (bytes), kernel graphics data (bytes)
|
|
|
|
and kernel secret data (bytes).
|
2017-10-29 22:09:54 +00:00
|
|
|
The expression
|
|
|
|
.IR n / m
|
|
|
|
indicates
|
|
|
|
.I n
|
|
|
|
used out of
|
|
|
|
.I m
|
|
|
|
available.
|
|
|
|
For kernel malloc and kernel draw,
|
|
|
|
.IR a
|
|
|
|
indicates the current allocation in bytes.
|
|
|
|
These numbers are not blank padded.
|
|
|
|
.PP
|
|
|
|
To turn on swapping, write to
|
|
|
|
.B swap
|
|
|
|
the textual file descriptor number of a file or device on which to swap.
|
2017-10-30 00:55:58 +00:00
|
|
|
.PP
|
|
|
|
Only the hostowner is allowed to enable swapping. The pages written to
|
|
|
|
the swap file are transparently encrypted by the kernel using a random key.
|
2017-10-29 22:09:54 +00:00
|
|
|
.SH SEE ALSO
|
2017-10-30 00:55:58 +00:00
|
|
|
.IR memory (8),
|
2017-10-29 22:09:54 +00:00
|
|
|
.IR swap (8).
|
|
|
|
.SH SOURCE
|
|
|
|
.B /sys/src/9/port/devswap.c
|