[0m


SWAPON(8)	    UNIX Programmer's Manual		SWAPON(8)



[1mNAME
     [0mswapon, swapoff - specify additional device for paging and
     swapping

[1mSYNOPSIS
     swapon -a
     swapon [0m[ [1m-p [0mpriority] [ [1m-n [0m] [ [1m-F [0m] name ...
     [1mswapon -l [0m[symfile]
     [1mswapoff [0mname

[1mDESCRIPTION
     [0m_S_w_a_p_o_n is used to specify additional areas on which paging
     and swapping are to take place. An area is usually a block
     special device, but can also be a regular file on the local
     machine or via NFS.  The system begins by swapping and pag-
     ing on only a single device so that only one disk is
     required at bootstrap time.  Calls to _s_w_a_p_o_n normally occur
     in the system multi-user initialization file /_e_t_c/_r_c making
     all swap devices available, so that the paging and swapping
     activity can be interleaved across several devices.

     The swap allocation strategy uses two parameters to control
     the allocation of swap space.  Process swap space is allo-
     cated from the lowest numbered _p_r_i_o_r_i_t_y (a value between 0
     and 7) first.  If _i_n_t_e_r_l_e_a_v_e is zero, then only a single
     area is permitted for this _p_r_i_o_r_i_t_y and an eight times
     larger swap area can be handled.  If _i_n_t_e_r_l_e_a_v_e is non-zero,
     then allocation within a priority is interleaved between all
     areas of the same _p_r_i_o_r_i_t_y.  Up to four swap areas can be
     interleaved at the same _p_r_i_o_r_i_t_y.	Priority zero must be
     interleaved, for kernel internal reasons.	It is not permit-
     ted to mix non-_i_n_t_e_r_l_e_a_v_e and _i_n_t_e_r_l_e_a_v_e within a _p_r_i_o_r_i_t_y.
     If a _p_r_i_o_r_i_t_y of -1 is given then the area is allocated
     automatically in the lowest numbered available _p_r_i_o_r_i_t_y, so
     the new area will be used first, considering existing swap
     areas and the interleave state requested.

     Normally, the [1m-a [0margument is given, causing all devices
     marked as type ``swap'' in /_e_t_c/_f_s_t_a_b to be made available,
     with the _p_r_i_o_r_i_t_y and _i_n_t_e_r_l_e_a_v_e specified by the [1mmnt_freq[0m,
     and [1mmnt_passno [0mfields.

     The second form adds only the space from area _n_a_m_e to the
     space available for swap allocation. _p_r_i_o_r_i_t_y can be speci-
     fied with the [1m-p [0moption, and the [1m-n [0moption specifies non-
     _i_n_t_e_r_l_e_a_v_e.  The [1m-F [0mcan be used to avoid the checks against
     destroying file systems, it should be used with extreme cau-
     tion.

     The [1m-l [0mform lists the current swap areas, with the number of
     blocks, priority (0-7), interleave (0-3) or exclusive, reads
     and writes for each area, with the words _p_e_r_m_a_n_e_n_t for the



Printed 18/6/99     Revision 1.6 of 21/10/90			1






SWAPON(8)	    UNIX Programmer's Manual		SWAPON(8)



     boot-time swap area, _s_w_a_p_o_f_f for an area undergoing swapoff
     in background, or _c_o_m_p_l_e_t_e for an area which has completed
     being swapped off in background.

     If the kernel has been booted from a file other than
     /_v_m_u_n_i_x, then that file can be given as _s_y_m_n_a_m_e.

     It is suggested that slow swap devices (such as UFS or NFS
     files) be used at a lower priority that the primary swap
     area (which is fixed at priority 4). Though access to these
     file system files is slow, they do allow additional swap
     space to be made available on existing systems without re-
     partitioning the disc.

     A fast block device (for example an external winchester)
     could either be used at a higher priority than the primary
     area, or if the kernel is modified (with adb or by rebuild-
     ing from the binary kit) the additional area can be inter-
     leaved with the primary swap area.

     _S_w_a_p_o_f_f can be used to remove an area from the space avail-
     able for swap allocation.	It can only do this if none of
     the swap area is in use (allocated to running processes) at
     the time.


[1mEXAMPLES
     [0mAssuming the kernel has been reconfigured to interleave the
     primary swap partition, then the following line /_e_t_c/_f_s_t_a_b
     would make /_d_e_v/_s_t_1_S available as a swap area when a
     _s_w_a_p_o_n -_a command was executed.
     /dev/st1S	    -	swap rw   4 1
     This could also be achieved by _s_w_a_p_o_n -_p _4 /_d_e_v/_s_t_1_S

[1mDIAGNOSTICS
     [0m_S_w_a_p_o_n [1m-a [0mwill print the total amount of swap space avail-
     able.

     _S_w_a_p_o_f_f may state that the swap area is busy at present, in
     which case the kernel will attempt to completely free the
     swap area as a background task. If this succeeds a log mes-
     sage is printed and the _s_w_a_p_o_f_f command should be repeated.
     The state of a background swapoff can be inspected with
     _s_w_a_p_o_n -_l.  The kernel will only try for about a minute to
     reclaim space from a swapped-off area, so it may be neces-
     sary to repeat the _s_w_a_p_o_f_f command more than once.

[1mSEE ALSO
     [0mswapon(2), swapoff(2), init(8)

[1mFILES
     [0m/etc/fstab



Printed 18/6/99     Revision 1.6 of 21/10/90			2






SWAPON(8)	    UNIX Programmer's Manual		SWAPON(8)



[1mBUGS
     [0mThe name is inappropriate since RISC iX does not swap, it
     only pages.

     Priority zero must be interleaved.

     The _p_r_i_o_r_i_t_y of the primary swap area is fixed at 4, and the
     _i_n_t_e_r_l_e_a_v_e is defined by the variable _s_w_a_p__i_n_t_e_r_l_e_a_v_e which
     can only be changed by _a_d_b(_1) or editing the file _p_a_r_a_m._c in
     the kernel binary kit.

     Space from the swap areas may be lost due to "rmap overflow"
     with this being indicated by messages from the kernel. If
     this happens, then the _s_w_a_p_o_f_f command will not be able to
     free the swap area. The kernel should be reconfigured with a
     larger values for _N_S_W_A_P_M_A_P and/or _d_m_m_a_x to prevent this hap-
     pening (these values can be changed within the kernel binary
     kit, again in _p_a_r_a_m._c).  _N_S_W_A_P_M_A_P defines the size of the
     table used to store free space in the swap map. Increasing
     the value of _d_m_m_a_x (default value 0x40) increases the max-
     imum possible size of each fragment stored in the table, and
     hence increases its total capacity. Increasing the value of
     _N_S_W_A_P_M_A_P increases the size of the table.	Too large a value
     of _d_m_m_a_x is inefficient since it can cause more swap space
     to be allocated than is actually required by a process,
     whereas increasing _N_S_W_A_P_M_A_P increases the amount of kernel
     memory used to store the free swap space map.




























Printed 18/6/99     Revision 1.6 of 21/10/90			3



[0m