1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>More Memory Management Functions</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="mm.html" title="Chapter&#160;4.&#160;Memory Management in Linux"><link rel="prev" href="API--copy-from-user.html" title="_copy_from_user"><link rel="next" href="API-read-cache-pages.html" title="read_cache_pages"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">More Memory Management Functions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API--copy-from-user.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;4.&#160;Memory Management in Linux</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-read-cache-pages.html">Next</a></td></tr></table><hr></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1123963508"></a>More Memory Management Functions</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-read-cache-pages.html"><span class="phrase">read_cache_pages</span></a></span><span class="refpurpose"> &#8212; 
2  populate an address space with some pages &amp; start reads against them
3 </span></dt><dt><span class="refentrytitle"><a href="API-page-cache-sync-readahead.html"><span class="phrase">page_cache_sync_readahead</span></a></span><span class="refpurpose"> &#8212; 
4     generic file readahead
5 </span></dt><dt><span class="refentrytitle"><a href="API-page-cache-async-readahead.html"><span class="phrase">page_cache_async_readahead</span></a></span><span class="refpurpose"> &#8212; 
6     file readahead for marked pages
7 </span></dt><dt><span class="refentrytitle"><a href="API-delete-from-page-cache.html"><span class="phrase">delete_from_page_cache</span></a></span><span class="refpurpose"> &#8212; 
8  delete page from page cache
9 </span></dt><dt><span class="refentrytitle"><a href="API-filemap-flush.html"><span class="phrase">filemap_flush</span></a></span><span class="refpurpose"> &#8212; 
10     mostly a non-blocking flush
11 </span></dt><dt><span class="refentrytitle"><a href="API-filemap-fdatawait-range.html"><span class="phrase">filemap_fdatawait_range</span></a></span><span class="refpurpose"> &#8212; 
12     wait for writeback to complete
13 </span></dt><dt><span class="refentrytitle"><a href="API-filemap-fdatawait.html"><span class="phrase">filemap_fdatawait</span></a></span><span class="refpurpose"> &#8212; 
14     wait for all under-writeback pages to complete
15 </span></dt><dt><span class="refentrytitle"><a href="API-filemap-write-and-wait-range.html"><span class="phrase">filemap_write_and_wait_range</span></a></span><span class="refpurpose"> &#8212; 
16     write out &amp; wait on a file range
17 </span></dt><dt><span class="refentrytitle"><a href="API-replace-page-cache-page.html"><span class="phrase">replace_page_cache_page</span></a></span><span class="refpurpose"> &#8212; 
18     replace a pagecache page with a new one
19 </span></dt><dt><span class="refentrytitle"><a href="API-add-to-page-cache-locked.html"><span class="phrase">add_to_page_cache_locked</span></a></span><span class="refpurpose"> &#8212; 
20     add a locked page to the pagecache
21 </span></dt><dt><span class="refentrytitle"><a href="API-add-page-wait-queue.html"><span class="phrase">add_page_wait_queue</span></a></span><span class="refpurpose"> &#8212; 
22     Add an arbitrary waiter to a page's wait queue
23 </span></dt><dt><span class="refentrytitle"><a href="API-unlock-page.html"><span class="phrase">unlock_page</span></a></span><span class="refpurpose"> &#8212; 
24     unlock a locked page
25 </span></dt><dt><span class="refentrytitle"><a href="API-end-page-writeback.html"><span class="phrase">end_page_writeback</span></a></span><span class="refpurpose"> &#8212; 
26     end writeback against a page
27 </span></dt><dt><span class="refentrytitle"><a href="API---lock-page.html"><span class="phrase">__lock_page</span></a></span><span class="refpurpose"> &#8212; 
28     get a lock on the page, assuming we need to sleep to get it
29 </span></dt><dt><span class="refentrytitle"><a href="API-page-cache-next-hole.html"><span class="phrase">page_cache_next_hole</span></a></span><span class="refpurpose"> &#8212; 
30     find the next hole (not-present entry)
31 </span></dt><dt><span class="refentrytitle"><a href="API-page-cache-prev-hole.html"><span class="phrase">page_cache_prev_hole</span></a></span><span class="refpurpose"> &#8212; 
32     find the prev hole (not-present entry)
33 </span></dt><dt><span class="refentrytitle"><a href="API-find-get-entry.html"><span class="phrase">find_get_entry</span></a></span><span class="refpurpose"> &#8212; 
34     find and get a page cache entry
35 </span></dt><dt><span class="refentrytitle"><a href="API-find-lock-entry.html"><span class="phrase">find_lock_entry</span></a></span><span class="refpurpose"> &#8212; 
36     locate, pin and lock a page cache entry
37 </span></dt><dt><span class="refentrytitle"><a href="API-pagecache-get-page.html"><span class="phrase">pagecache_get_page</span></a></span><span class="refpurpose"> &#8212; 
38     find and get a page reference
39 </span></dt><dt><span class="refentrytitle"><a href="API-find-get-pages-contig.html"><span class="phrase">find_get_pages_contig</span></a></span><span class="refpurpose"> &#8212; 
40     gang contiguous pagecache lookup
41 </span></dt><dt><span class="refentrytitle"><a href="API-find-get-pages-tag.html"><span class="phrase">find_get_pages_tag</span></a></span><span class="refpurpose"> &#8212; 
42     find and return pages that match <em class="parameter"><code>tag</code></em>
43 </span></dt><dt><span class="refentrytitle"><a href="API-generic-file-read-iter.html"><span class="phrase">generic_file_read_iter</span></a></span><span class="refpurpose"> &#8212; 
44     generic filesystem read routine
45 </span></dt><dt><span class="refentrytitle"><a href="API-filemap-fault.html"><span class="phrase">filemap_fault</span></a></span><span class="refpurpose"> &#8212; 
46     read in file data for page fault handling
47 </span></dt><dt><span class="refentrytitle"><a href="API-read-cache-page.html"><span class="phrase">read_cache_page</span></a></span><span class="refpurpose"> &#8212; 
48     read into page cache, fill it if needed
49 </span></dt><dt><span class="refentrytitle"><a href="API-read-cache-page-gfp.html"><span class="phrase">read_cache_page_gfp</span></a></span><span class="refpurpose"> &#8212; 
50     read into page cache, using specified page allocation flags.
51 </span></dt><dt><span class="refentrytitle"><a href="API---generic-file-write-iter.html"><span class="phrase">__generic_file_write_iter</span></a></span><span class="refpurpose"> &#8212; 
52     write data to a file
53 </span></dt><dt><span class="refentrytitle"><a href="API-generic-file-write-iter.html"><span class="phrase">generic_file_write_iter</span></a></span><span class="refpurpose"> &#8212; 
54     write data to a file
55 </span></dt><dt><span class="refentrytitle"><a href="API-try-to-release-page.html"><span class="phrase">try_to_release_page</span></a></span><span class="refpurpose"> &#8212; 
56     release old fs-specific metadata on a page
57 </span></dt><dt><span class="refentrytitle"><a href="API-zap-vma-ptes.html"><span class="phrase">zap_vma_ptes</span></a></span><span class="refpurpose"> &#8212; 
58  remove ptes mapping the vma
59 </span></dt><dt><span class="refentrytitle"><a href="API-vm-insert-page.html"><span class="phrase">vm_insert_page</span></a></span><span class="refpurpose"> &#8212; 
60     insert single page into user vma
61 </span></dt><dt><span class="refentrytitle"><a href="API-vm-insert-pfn.html"><span class="phrase">vm_insert_pfn</span></a></span><span class="refpurpose"> &#8212; 
62     insert single pfn into user vma
63 </span></dt><dt><span class="refentrytitle"><a href="API-remap-pfn-range.html"><span class="phrase">remap_pfn_range</span></a></span><span class="refpurpose"> &#8212; 
64     remap kernel memory to userspace
65 </span></dt><dt><span class="refentrytitle"><a href="API-vm-iomap-memory.html"><span class="phrase">vm_iomap_memory</span></a></span><span class="refpurpose"> &#8212; 
66     remap memory to userspace
67 </span></dt><dt><span class="refentrytitle"><a href="API-unmap-mapping-range.html"><span class="phrase">unmap_mapping_range</span></a></span><span class="refpurpose"> &#8212; 
68     unmap the portion of all mmaps in the specified address_space corresponding to the specified page range in the underlying file.
69 </span></dt><dt><span class="refentrytitle"><a href="API-follow-pfn.html"><span class="phrase">follow_pfn</span></a></span><span class="refpurpose"> &#8212; 
70     look up PFN at a user virtual address
71 </span></dt><dt><span class="refentrytitle"><a href="API-vm-unmap-aliases.html"><span class="phrase">vm_unmap_aliases</span></a></span><span class="refpurpose"> &#8212; 
72  unmap outstanding lazy aliases in the vmap layer
73 </span></dt><dt><span class="refentrytitle"><a href="API-vm-unmap-ram.html"><span class="phrase">vm_unmap_ram</span></a></span><span class="refpurpose"> &#8212; 
74     unmap linear kernel address space set up by vm_map_ram
75 </span></dt><dt><span class="refentrytitle"><a href="API-vm-map-ram.html"><span class="phrase">vm_map_ram</span></a></span><span class="refpurpose"> &#8212; 
76     map pages linearly into kernel virtual address (vmalloc space)
77 </span></dt><dt><span class="refentrytitle"><a href="API-unmap-kernel-range-noflush.html"><span class="phrase">unmap_kernel_range_noflush</span></a></span><span class="refpurpose"> &#8212; 
78     unmap kernel VM area
79 </span></dt><dt><span class="refentrytitle"><a href="API-unmap-kernel-range.html"><span class="phrase">unmap_kernel_range</span></a></span><span class="refpurpose"> &#8212; 
80     unmap kernel VM area and flush cache and TLB
81 </span></dt><dt><span class="refentrytitle"><a href="API-vfree.html"><span class="phrase">vfree</span></a></span><span class="refpurpose"> &#8212; 
82     release memory allocated by <code class="function">vmalloc</code>
83 </span></dt><dt><span class="refentrytitle"><a href="API-vunmap.html"><span class="phrase">vunmap</span></a></span><span class="refpurpose"> &#8212; 
84     release virtual mapping obtained by <code class="function">vmap</code>
85 </span></dt><dt><span class="refentrytitle"><a href="API-vmap.html"><span class="phrase">vmap</span></a></span><span class="refpurpose"> &#8212; 
86     map an array of pages into virtually contiguous space
87 </span></dt><dt><span class="refentrytitle"><a href="API-vmalloc.html"><span class="phrase">vmalloc</span></a></span><span class="refpurpose"> &#8212; 
88     allocate virtually contiguous memory
89 </span></dt><dt><span class="refentrytitle"><a href="API-vzalloc.html"><span class="phrase">vzalloc</span></a></span><span class="refpurpose"> &#8212; 
90     allocate virtually contiguous memory with zero fill
91 </span></dt><dt><span class="refentrytitle"><a href="API-vmalloc-user.html"><span class="phrase">vmalloc_user</span></a></span><span class="refpurpose"> &#8212; 
92     allocate zeroed virtually contiguous memory for userspace
93 </span></dt><dt><span class="refentrytitle"><a href="API-vmalloc-node.html"><span class="phrase">vmalloc_node</span></a></span><span class="refpurpose"> &#8212; 
94     allocate memory on a specific node
95 </span></dt><dt><span class="refentrytitle"><a href="API-vzalloc-node.html"><span class="phrase">vzalloc_node</span></a></span><span class="refpurpose"> &#8212; 
96     allocate memory on a specific node with zero fill
97 </span></dt><dt><span class="refentrytitle"><a href="API-vmalloc-32.html"><span class="phrase">vmalloc_32</span></a></span><span class="refpurpose"> &#8212; 
98     allocate virtually contiguous memory (32bit addressable)
99 </span></dt><dt><span class="refentrytitle"><a href="API-vmalloc-32-user.html"><span class="phrase">vmalloc_32_user</span></a></span><span class="refpurpose"> &#8212; 
100     allocate zeroed virtually contiguous 32bit memory
101 </span></dt><dt><span class="refentrytitle"><a href="API-remap-vmalloc-range-partial.html"><span class="phrase">remap_vmalloc_range_partial</span></a></span><span class="refpurpose"> &#8212; 
102     map vmalloc pages to userspace
103 </span></dt><dt><span class="refentrytitle"><a href="API-remap-vmalloc-range.html"><span class="phrase">remap_vmalloc_range</span></a></span><span class="refpurpose"> &#8212; 
104     map vmalloc pages to userspace
105 </span></dt><dt><span class="refentrytitle"><a href="API-alloc-vm-area.html"><span class="phrase">alloc_vm_area</span></a></span><span class="refpurpose"> &#8212; 
106     allocate a range of kernel address space
107 </span></dt><dt><span class="refentrytitle"><a href="API-alloc-pages-exact-nid.html"><span class="phrase">alloc_pages_exact_nid</span></a></span><span class="refpurpose"> &#8212; 
108  allocate an exact number of physically-contiguous pages on a node.
109 </span></dt><dt><span class="refentrytitle"><a href="API-nr-free-zone-pages.html"><span class="phrase">nr_free_zone_pages</span></a></span><span class="refpurpose"> &#8212; 
110     count number of pages beyond high watermark
111 </span></dt><dt><span class="refentrytitle"><a href="API-nr-free-pagecache-pages.html"><span class="phrase">nr_free_pagecache_pages</span></a></span><span class="refpurpose"> &#8212; 
112     count number of pages beyond high watermark
113 </span></dt><dt><span class="refentrytitle"><a href="API-find-next-best-node.html"><span class="phrase">find_next_best_node</span></a></span><span class="refpurpose"> &#8212; 
114     find the next node that should appear in a given node's fallback list
115 </span></dt><dt><span class="refentrytitle"><a href="API-free-bootmem-with-active-regions.html"><span class="phrase">free_bootmem_with_active_regions</span></a></span><span class="refpurpose"> &#8212; 
116     Call memblock_free_early_nid for each active range
117 </span></dt><dt><span class="refentrytitle"><a href="API-sparse-memory-present-with-active-regions.html"><span class="phrase">sparse_memory_present_with_active_regions</span></a></span><span class="refpurpose"> &#8212; 
118     Call memory_present for each active range
119 </span></dt><dt><span class="refentrytitle"><a href="API-get-pfn-range-for-nid.html"><span class="phrase">get_pfn_range_for_nid</span></a></span><span class="refpurpose"> &#8212; 
120     Return the start and end page frames for a node
121 </span></dt><dt><span class="refentrytitle"><a href="API-absent-pages-in-range.html"><span class="phrase">absent_pages_in_range</span></a></span><span class="refpurpose"> &#8212; 
122     Return number of page frames in holes within a range
123 </span></dt><dt><span class="refentrytitle"><a href="API-node-map-pfn-alignment.html"><span class="phrase">node_map_pfn_alignment</span></a></span><span class="refpurpose"> &#8212; 
124     determine the maximum internode alignment
125 </span></dt><dt><span class="refentrytitle"><a href="API-find-min-pfn-with-active-regions.html"><span class="phrase">find_min_pfn_with_active_regions</span></a></span><span class="refpurpose"> &#8212; 
126     Find the minimum PFN registered
127 </span></dt><dt><span class="refentrytitle"><a href="API-free-area-init-nodes.html"><span class="phrase">free_area_init_nodes</span></a></span><span class="refpurpose"> &#8212; 
128     Initialise all pg_data_t and zone data
129 </span></dt><dt><span class="refentrytitle"><a href="API-set-dma-reserve.html"><span class="phrase">set_dma_reserve</span></a></span><span class="refpurpose"> &#8212; 
130     set the specified number of pages reserved in the first zone
131 </span></dt><dt><span class="refentrytitle"><a href="API-setup-per-zone-wmarks.html"><span class="phrase">setup_per_zone_wmarks</span></a></span><span class="refpurpose"> &#8212; 
132     called when min_free_kbytes changes or when memory is hot-{added|removed}
133 </span></dt><dt><span class="refentrytitle"><a href="API-get-pfnblock-flags-mask.html"><span class="phrase">get_pfnblock_flags_mask</span></a></span><span class="refpurpose"> &#8212; 
134     Return the requested group of flags for the pageblock_nr_pages block of pages
135 </span></dt><dt><span class="refentrytitle"><a href="API-set-pfnblock-flags-mask.html"><span class="phrase">set_pfnblock_flags_mask</span></a></span><span class="refpurpose"> &#8212; 
136     Set the requested group of flags for a pageblock_nr_pages block of pages
137 </span></dt><dt><span class="refentrytitle"><a href="API-alloc-contig-range.html"><span class="phrase">alloc_contig_range</span></a></span><span class="refpurpose"> &#8212; 
138     - tries to allocate given range of pages
139 </span></dt><dt><span class="refentrytitle"><a href="API-mempool-destroy.html"><span class="phrase">mempool_destroy</span></a></span><span class="refpurpose"> &#8212; 
140  deallocate a memory pool
141 </span></dt><dt><span class="refentrytitle"><a href="API-mempool-create.html"><span class="phrase">mempool_create</span></a></span><span class="refpurpose"> &#8212; 
142     create a memory pool
143 </span></dt><dt><span class="refentrytitle"><a href="API-mempool-resize.html"><span class="phrase">mempool_resize</span></a></span><span class="refpurpose"> &#8212; 
144     resize an existing memory pool
145 </span></dt><dt><span class="refentrytitle"><a href="API-mempool-alloc.html"><span class="phrase">mempool_alloc</span></a></span><span class="refpurpose"> &#8212; 
146     allocate an element from a specific memory pool
147 </span></dt><dt><span class="refentrytitle"><a href="API-mempool-free.html"><span class="phrase">mempool_free</span></a></span><span class="refpurpose"> &#8212; 
148     return an element to the pool.
149 </span></dt><dt><span class="refentrytitle"><a href="API-dma-pool-create.html"><span class="phrase">dma_pool_create</span></a></span><span class="refpurpose"> &#8212; 
150  Creates a pool of consistent memory blocks, for dma.
151 </span></dt><dt><span class="refentrytitle"><a href="API-dma-pool-destroy.html"><span class="phrase">dma_pool_destroy</span></a></span><span class="refpurpose"> &#8212; 
152     destroys a pool of dma memory blocks.
153 </span></dt><dt><span class="refentrytitle"><a href="API-dma-pool-alloc.html"><span class="phrase">dma_pool_alloc</span></a></span><span class="refpurpose"> &#8212; 
154     get a block of consistent memory
155 </span></dt><dt><span class="refentrytitle"><a href="API-dma-pool-free.html"><span class="phrase">dma_pool_free</span></a></span><span class="refpurpose"> &#8212; 
156     put block back into dma pool
157 </span></dt><dt><span class="refentrytitle"><a href="API-dmam-pool-create.html"><span class="phrase">dmam_pool_create</span></a></span><span class="refpurpose"> &#8212; 
158     Managed <code class="function">dma_pool_create</code>
159 </span></dt><dt><span class="refentrytitle"><a href="API-dmam-pool-destroy.html"><span class="phrase">dmam_pool_destroy</span></a></span><span class="refpurpose"> &#8212; 
160     Managed <code class="function">dma_pool_destroy</code>
161 </span></dt><dt><span class="refentrytitle"><a href="API-balance-dirty-pages-ratelimited.html"><span class="phrase">balance_dirty_pages_ratelimited</span></a></span><span class="refpurpose"> &#8212; 
162  balance dirty memory state
163 </span></dt><dt><span class="refentrytitle"><a href="API-tag-pages-for-writeback.html"><span class="phrase">tag_pages_for_writeback</span></a></span><span class="refpurpose"> &#8212; 
164     tag pages to be written by write_cache_pages
165 </span></dt><dt><span class="refentrytitle"><a href="API-write-cache-pages.html"><span class="phrase">write_cache_pages</span></a></span><span class="refpurpose"> &#8212; 
166     walk the list of dirty pages of the given address space and write all of them.
167 </span></dt><dt><span class="refentrytitle"><a href="API-generic-writepages.html"><span class="phrase">generic_writepages</span></a></span><span class="refpurpose"> &#8212; 
168     walk the list of dirty pages of the given address space and <code class="function">writepage</code> all of them.
169 </span></dt><dt><span class="refentrytitle"><a href="API-write-one-page.html"><span class="phrase">write_one_page</span></a></span><span class="refpurpose"> &#8212; 
170     write out a single page and optionally wait on I/O
171 </span></dt><dt><span class="refentrytitle"><a href="API-wait-for-stable-page.html"><span class="phrase">wait_for_stable_page</span></a></span><span class="refpurpose"> &#8212; 
172     wait for writeback to finish, if necessary.
173 </span></dt><dt><span class="refentrytitle"><a href="API-truncate-inode-pages-range.html"><span class="phrase">truncate_inode_pages_range</span></a></span><span class="refpurpose"> &#8212; 
174  truncate range of pages specified by start &amp; end byte offsets
175 </span></dt><dt><span class="refentrytitle"><a href="API-truncate-inode-pages.html"><span class="phrase">truncate_inode_pages</span></a></span><span class="refpurpose"> &#8212; 
176     truncate *all* the pages from an offset
177 </span></dt><dt><span class="refentrytitle"><a href="API-truncate-inode-pages-final.html"><span class="phrase">truncate_inode_pages_final</span></a></span><span class="refpurpose"> &#8212; 
178     truncate *all* pages before inode dies
179 </span></dt><dt><span class="refentrytitle"><a href="API-invalidate-mapping-pages.html"><span class="phrase">invalidate_mapping_pages</span></a></span><span class="refpurpose"> &#8212; 
180     Invalidate all the unlocked pages of one inode
181 </span></dt><dt><span class="refentrytitle"><a href="API-invalidate-inode-pages2-range.html"><span class="phrase">invalidate_inode_pages2_range</span></a></span><span class="refpurpose"> &#8212; 
182     remove range of pages from an address_space
183 </span></dt><dt><span class="refentrytitle"><a href="API-invalidate-inode-pages2.html"><span class="phrase">invalidate_inode_pages2</span></a></span><span class="refpurpose"> &#8212; 
184     remove all pages from an address_space
185 </span></dt><dt><span class="refentrytitle"><a href="API-truncate-pagecache.html"><span class="phrase">truncate_pagecache</span></a></span><span class="refpurpose"> &#8212; 
186     unmap and remove pagecache that has been truncated
187 </span></dt><dt><span class="refentrytitle"><a href="API-truncate-setsize.html"><span class="phrase">truncate_setsize</span></a></span><span class="refpurpose"> &#8212; 
188     update inode and pagecache for a new file size
189 </span></dt><dt><span class="refentrytitle"><a href="API-pagecache-isize-extended.html"><span class="phrase">pagecache_isize_extended</span></a></span><span class="refpurpose"> &#8212; 
190     update pagecache after extension of i_size
191 </span></dt><dt><span class="refentrytitle"><a href="API-truncate-pagecache-range.html"><span class="phrase">truncate_pagecache_range</span></a></span><span class="refpurpose"> &#8212; 
192     unmap and remove pagecache that is hole-punched
193 </span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API--copy-from-user.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="mm.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-read-cache-pages.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">_copy_from_user</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">read_cache_pages</span></td></tr></table></div></body></html>
194