Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ madvise(2) — SunOS 0.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mmap(2)

mincore(2)

mremap(2)

munmap(2)

MADVISE(2)  —  System Interface Manual — System Calls

NAME

madvise − give advice to the paging system

SYNOPSIS

#include <mman.h>
#include <sys/types.h>

madvise(addr, len, behavior)
caddr_t addr; int len, behavior;

DESCRIPTION

This 4.3 call is not implemented in 4.2.

Madvise is used to inform the system that process paging behavior merits special consideration.  The call specifies that memory starting at addr and continuing for len bytes will exhibit a particular behavior. The system may use this information to alter its paging policy as best suits this behavior, though nothing is guaranteed.

MADV_RANDOM
advises that the paging behavior is not likely to be well handled by the system’s default algorithm, since reference information collected over macroscopic intervals (e.g. 10-20 seconds) will not serve to indicate future page references.  The system in this case will choose to replace pages with little emphasis placed on recent usage, and more emphasis on referenceless circular behavior.  It is essential that processes which have very random paging behavior (such as LISP during garbage collection of very large address spaces) call madvise, as otherwise the system has great difficulty dealing with their page-consumptive demands. 

MADV_NORMAL
restores default paging replacement behavior.

MADV_SEQUENTIAL
indicates sequential access should be expected in the area of memory indicated.  The system should try and prepage forward of the current reference, where possible. 

MADVISE_WILLNEED
advises the system that the memory indicated will be needed in the future and the associated pages should not be, if possible, reclaimed.

MADVISE_WONTNEED
tells the system that the process has no further need for the memory indicated and the associated pages may be immediately reclaimed.

RETURN VALUE

??? 

ERRORS

??? 

SEE ALSO

mmap(2), mincore(2), mremap(2), munmap(2)

Sun System Release 0.3  —  25 April 1983

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026