vm_releasep Kernel Service

Purpose

Releases virtual memory resources for the specified page range.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include  <sys/vmuser.h>

int  vm_releasep ( vmid,  pfirst,  npages)
vmid_t  vmid;
int pfirst;
int npages;

Description

The vm_releasep kernel service releases pages for the specified page range in the virtual memory object. The values in the pfirst and npages parameters must be nonnegative.

Each page of the virtual memory object that intersects the page range (pfirstpfirst npages -1) is logically reset to 0, and any page frame is discarded. A page frame in the I/O state is marked for discard at I/O completion.

For working storage, paging-space disk blocks are freed and the storage-protect key is reset to the default value.

Note: All of the pages to be released must be in the same virtual memory object.
Note: The vm_releasep subroutine is not supported for use on large pages.

Parameters

Item Description
vmid Specifies the virtual memory object identifier.
pfirst Specifies the first page number in the specified page range.
npages Specifies the number of pages in the specified page range.

Execution Environment

The vm_releasep kernel service can be called from the process environment only.

Return Values

Item Description
0 Indicates a successful operation.
EINVAL Indicates one of the following errors:
  • An invalid virtual memory object ID.
  • The starting page is negative.
  • Number of pages is negative.
  • Page range crosses a virtual memory object boundary.
  • One or more large pages lie in the target page range.