1 <h2>vm_behavior_set
</h2>
4 <strong>Function
</strong> - Specify expected access patterns for the target VM region.
7 <strong>kern_return_t vm_behavior_set
</strong>
8 <strong>(vm_task_t
</strong> <var>target_task
</var>,
9 <strong>vm_address_t
</strong> <var>address
</var>,
10 <strong>vm_size_t
</strong> <var>size
</var>,
11 <strong>vm_behavior_t
</strong> <var>behavior
</var><strong>);
</strong>
16 <dt> <var>target_task
</var>
19 The port for the task in whose address space the
20 memory object behavior is to be set.
22 <dt> <var>address
</var>
25 The starting address for the memory region.
30 The number of bytes in the region.
32 <dt> <var>behavior
</var>
35 The expected reference pattern for the memory. Possible
39 <dt> <strong>VM_BEHAVIOR_DEFAULT
</strong>
41 The system's default behavior. Assumes strong locality of
42 reference, so LRU page replacement, possibly with pre-fetch,
45 <dt> <strong>VM_BEHAVIOR_RANDOM
</strong>
47 No particular order expected. Assumes weak locality of
48 reference, so LRU page replacement may be ineffective.
50 <dt> <strong>VM_BEHAVIOR_SEQUENTIAL
</strong>
52 Forward sequential order.
54 <dt> <strong>VM_BEHAVIOR_RSEQNTL
</strong>
56 Reverse sequential order.
61 The
<strong>vm_behavior_set
</strong> function informs the kernel of
63 pattern for a region of memory. The kernel uses this information
64 to bias its prefetch and page
65 replacement algorithms.
67 The region starts at the beginning of the virtual page containing
68 <var>address
</var>; it ends at the end of the virtual page containing
69 <var>address
</var> +
<var>size
</var> -
1. Because of this
70 rounding to virtual page boundaries, the amount of memory affected may be
71 greater than
<var>size
</var>. Use
<strong>host_page_size
</strong>
72 to find the current virtual page size.
75 This interface is machine word length specific because of the virtual address
77 <h3>RETURN VALUES
</h3>
80 <dt> <strong>KERN_INVALID_ADDRESS
</strong>
82 The specified address is illegal or reserved.
84 <h3>RELATED INFORMATION
</h3>
87 <a href=
"vm_region.html"><strong>vm_region
</strong></a>,
88 <a href=
"host_page_size.html"><strong>host_page_size
</strong></a>.