vm_flushp Kernel Service

Purpose

Flushes the specified range of pages.

Syntax

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

int vm_flushp ( sid, pfirst, npages)
vmid_t sid;
vpn_t pfirst;
vpn_t npages;

Parameters

Item Description
sid Identifies the base segment.
pfirst The first page number within the range.
npages The number of pages to flush starting from the pfirst value. All pages must be in the same segment.

Description

The vm_flushp kernel service routine initiates page-out for the specified page range in the virtual memory object. I/O is initiated for the modified pages only. If page-out is initiated, or the pages are currently undergoing page I/O, then they are flagged to have their page frames released upon completion. If the pages are not modified, their page frames are immediately released.

The caller can wait for the completion of I/O initiated by this and prior calls by calling the vms_iowait kernel service.

Note: The vm_flushp subroutine is not supported for use on large pages.

Execution Environment

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

This is intended for files, and might not be called for working storage segments.

Return Values

Item Description
0 Indicates the completion of the flush operation.
EINVAL Indicates one of the following errors:
  • pfirst < 0.
  • npages < 0.
  • Page interval not in one segment.
  • Invalid sid parameter.
  • Invalid segment type.