]>
Commit | Line | Data |
---|---|---|
9bccf70c | 1 | <h2>vm_behavior_set</h2>\r<hr>\r<p>\r<strong>Function</strong> - Specify expected access patterns for the target VM region.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t vm_behavior_set</strong>\r <strong>(vm_task_t</strong> <var>target_task</var>,\r <strong>vm_address_t</strong> <var>address</var>,\r <strong>vm_size_t</strong> <var>size</var>,\r <strong>vm_behavior_t</strong> <var>behavior</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<p>\r<dt> <var>target_task</var> \r<dd>\r[in task send right]\rThe port for the task in whose address space the \rmemory object behavior is to be set.\r<p>\r<dt> <var>address</var> \r<dd>\r[in scalar]\rThe starting address for the memory region.\r<p>\r<dt> <var>size</var> \r<dd>\r[in scalar]\rThe number of bytes in the region.\r<p>\r<dt> <var>behavior</var> \r<dd>\r[in scalar]\rThe expected reference pattern for the memory. Possible\rvalues are:\r<dl>\r<p>\r<dt> <strong>VM_BEHAVIOR_DEFAULT</strong>\r<dd>\rThe system's default behavior. Assumes strong locality of\rreference, so LRU page replacement, possibly with pre-fetch, \rwould be appropriate.\r<p>\r<dt> <strong>VM_BEHAVIOR_RANDOM</strong>\r<dd>\rNo particular order expected. Assumes weak locality of\rreference, so LRU page replacement may be ineffective.\r<p>\r<dt> <strong>VM_BEHAVIOR_SEQUENTIAL</strong>\r<dd>\rForward sequential order.\r<p>\r<dt> <strong>VM_BEHAVIOR_RSEQNTL</strong>\r<dd>\rReverse sequential order.\r</dl>\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>vm_behavior_set</strong> function informs the kernel of\rthe expected access\rpattern for a region of memory. The kernel uses this information\rto bias its prefetch and page\rreplacement algorithms.\r<p>\rThe region starts at the beginning of the virtual page containing\r<var>address</var>; it ends at the end of the virtual page containing \r<var>address</var> + <var>size</var> - 1. Because of this \rrounding to virtual page boundaries, the amount of memory affected may be \rgreater than <var>size</var>. Use <strong>host_page_size</strong>\rto find the current virtual page size.\r<h3>NOTES</h3>\r<p>\rThis interface is machine word length specific because of the virtual address\rparameter.\r<h3>RETURN VALUES</h3>\r<dl>\r<p>\r<dt> <strong>KERN_INVALID_ADDRESS</strong>\r<dd>\rThe specified address is illegal or reserved.\r</dl>\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="vm_region.html"><strong>vm_region</strong></a>,\r<a href="host_page_size.html"><strong>host_page_size</strong></a>.\r |