xref: /xnu-10002.41.9/osfmk/man/memory_object_attr_info.html (revision 699cd48037512bf4380799317ca44ca453c82f57)
1*699cd480SApple OSS Distributions<h2>memory_object_attr_info</h2>
2*699cd480SApple OSS Distributions<hr>
3*699cd480SApple OSS Distributions<p>
4*699cd480SApple OSS Distributions<strong>Structure</strong> - Specifies memory object's behavior attributes.
5*699cd480SApple OSS Distributions<h3>SYNOPSIS</h3>
6*699cd480SApple OSS Distributions<pre>
7*699cd480SApple OSS Distributions<strong>struct  memory_object_attr_info</strong>
8*699cd480SApple OSS Distributions<strong>{</strong>
9*699cd480SApple OSS Distributions        <strong>memory_object_copy_strategy_t</strong>    <var>copy_strategy</var><strong>;</strong>
10*699cd480SApple OSS Distributions        <strong>vm_offset_t</strong>                       <var>cluster_size</var><strong>;</strong>
11*699cd480SApple OSS Distributions        <strong>boolean_t</strong>                            <var>may_cache</var><strong>;</strong>
12*699cd480SApple OSS Distributions        <strong>boolean_t</strong>                            <var>temporary</var><strong>;</strong>
13*699cd480SApple OSS Distributions<strong>};</strong>
14*699cd480SApple OSS Distributions
15*699cd480SApple OSS Distributions<strong>typedef struct memory_object_attr_info* memory_object_attr_info_t;</strong>
16*699cd480SApple OSS Distributions</pre>
17*699cd480SApple OSS Distributions<h3>FIELDS</h3>
18*699cd480SApple OSS Distributions<dl>
19*699cd480SApple OSS Distributions<dt> <var>copy_strategy</var>
20*699cd480SApple OSS Distributions<dd>
21*699cd480SApple OSS DistributionsHow the kernel should handle copying of regions associated with the
22*699cd480SApple OSS Distributionsmemory object.  The copy strategy cannot be changed once an object is
23*699cd480SApple OSS Distributionsinitialized.  Valid values are:
24*699cd480SApple OSS Distributions<dl>
25*699cd480SApple OSS Distributions<p>
26*699cd480SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_NONE</strong>
27*699cd480SApple OSS Distributions<dd>
28*699cd480SApple OSS DistributionsUse normal procedure when copying the memory object's
29*699cd480SApple OSS Distributionsdata.  Normally, the kernel requests each page with read
30*699cd480SApple OSS Distributionsaccess, copies the data, and then (optionally) flushes the data.
31*699cd480SApple OSS Distributions<p>
32*699cd480SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_CALL</strong>
33*699cd480SApple OSS Distributions<dd>
34*699cd480SApple OSS DistributionsCall the memory manager when a copy operation is necessary.
35*699cd480SApple OSS Distributions<p>
36*699cd480SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_DELAY</strong>
37*699cd480SApple OSS Distributions<dd>
38*699cd480SApple OSS DistributionsUse copy-on-write technique.  This strategy allows the kernel
39*699cd480SApple OSS Distributionsto efficiently copy large amounts of data and guarantees that
40*699cd480SApple OSS Distributionsthe memory manager will not externally modify the data.  It is
41*699cd480SApple OSS Distributionsthe most commonly used copy strategy.
42*699cd480SApple OSS Distributions<p>
43*699cd480SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_TEMPORARY</strong>
44*699cd480SApple OSS Distributions<dd>
45*699cd480SApple OSS DistributionsAll changes are made in memory and the memory manager does not need
46*699cd480SApple OSS Distributionsto see them.
47*699cd480SApple OSS Distributions<p>
48*699cd480SApple OSS Distributions<dt> <strong>MEMORY_OBJECT_COPY_SYMMETRIC</strong>
49*699cd480SApple OSS Distributions<dd>
50*699cd480SApple OSS DistributionsThe memory manager does not change the data, does not need to see
51*699cd480SApple OSS Distributionsany changes to the data, and will prevent the object from being
52*699cd480SApple OSS Distributionsmapped more than once.  Currently, this strategy should be restricted
53*699cd480SApple OSS Distributionsto use by the kernel.
54*699cd480SApple OSS Distributions</dl>
55*699cd480SApple OSS Distributions<p>
56*699cd480SApple OSS Distributions<dt> <var>cluster_size</var>
57*699cd480SApple OSS Distributions<dd>
58*699cd480SApple OSS DistributionsThe memory object's perferred cluster size (in bytes).  This value may affect
59*699cd480SApple OSS Distributionsthe number of pages transferred in a given paging operation.
60*699cd480SApple OSS Distributions<p>
61*699cd480SApple OSS Distributions<dt> <var>may_cache</var>
62*699cd480SApple OSS Distributions<dd>
63*699cd480SApple OSS DistributionsCache indicator.  If true, the kernel can cache data associated with the
64*699cd480SApple OSS Distributionsmemory object (keep the memory object active) even if no virtual
65*699cd480SApple OSS Distributionsmemory references to it remain.
66*699cd480SApple OSS Distributions<p>
67*699cd480SApple OSS Distributions<dt> <var>temporary</var>
68*699cd480SApple OSS Distributions<dd>
69*699cd480SApple OSS DistributionsIf TRUE, when the last mapping to the object is released,
70*699cd480SApple OSS Distributionsthe kernel destroys the object without returning any resident pages.
71*699cd480SApple OSS Distributions</dl>
72*699cd480SApple OSS Distributions<h3>DESCRIPTION</h3>
73*699cd480SApple OSS Distributions<p>
74*699cd480SApple OSS DistributionsThe <strong>memory_object_attr_info</strong> structure defines behavior and
75*699cd480SApple OSS Distributionsperformance relevant memory object attributes.
76*699cd480SApple OSS Distributions<h3>RELATED INFORMATION</h3>
77*699cd480SApple OSS Distributions<p>
78*699cd480SApple OSS DistributionsFunctions:
79*699cd480SApple OSS Distributions<a href="MO_get_attributes.html"><strong>memory_object_get_attributes</strong></a>,
80*699cd480SApple OSS Distributions<a href="MO_change_attributes.html"><strong>memory_object_change_attributes</strong></a>,
81*699cd480SApple OSS Distributions<a href="vm_region.html"><strong>vm_region</strong></a>,
82*699cd480SApple OSS Distributions<a href="memory_object_synchronize.html"><strong>memory_object_synchronize</strong></a>,
83*699cd480SApple OSS Distributions<a href="VSD_memory_manager.html"><strong>vm_set_default_memory_manager</strong></a>,
84*699cd480SApple OSS Distributions<a href="vm_msync.html"><strong>vm_msync</strong></a>.
85