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