Lines Matching full:pages

22  * pcpu_get_pages - get temp pages array
29 * Pointer to temp pages array on success.
33 static struct page **pages; in pcpu_get_pages() local
34 size_t pages_size = pcpu_nr_units * pcpu_unit_pages * sizeof(pages[0]); in pcpu_get_pages()
38 if (!pages) in pcpu_get_pages()
39 pages = pcpu_mem_zalloc(pages_size, GFP_KERNEL); in pcpu_get_pages()
40 return pages; in pcpu_get_pages()
44 * pcpu_free_pages - free pages which were allocated for @chunk
45 * @chunk: chunk pages were allocated for
46 * @pages: array of pages to be freed, indexed by pcpu_page_idx()
50 * Free pages [@page_start and @page_end) in @pages for all units.
51 * The pages were allocated for @chunk.
54 struct page **pages, int page_start, int page_end) in pcpu_free_pages() argument
61 struct page *page = pages[pcpu_page_idx(cpu, i)]; in pcpu_free_pages()
70 * pcpu_alloc_pages - allocates pages for @chunk
72 * @pages: array to put the allocated pages into, indexed by pcpu_page_idx()
77 * Allocate pages [@page_start,@page_end) into @pages for all units.
79 * content of @pages and will pass it verbatim to pcpu_map_pages().
82 struct page **pages, int page_start, int page_end, in pcpu_alloc_pages() argument
92 struct page **pagep = &pages[pcpu_page_idx(cpu, i)]; in pcpu_alloc_pages()
103 __free_page(pages[pcpu_page_idx(cpu, i)]); in pcpu_alloc_pages()
109 __free_page(pages[pcpu_page_idx(tcpu, i)]); in pcpu_alloc_pages()
120 * Pages in [@page_start,@page_end) of @chunk are about to be
140 * pcpu_unmap_pages - unmap pages out of a pcpu_chunk
142 * @pages: pages array which can be used to pass information to free
146 * For each cpu, unmap pages [@page_start,@page_end) out of @chunk.
147 * Corresponding elements in @pages were cleared by the caller and can
153 struct page **pages, int page_start, int page_end) in pcpu_unmap_pages() argument
164 pages[pcpu_page_idx(cpu, i)] = page; in pcpu_unmap_pages()
177 * Pages [@page_start,@page_end) of @chunk have been unmapped. Flush
192 static int __pcpu_map_pages(unsigned long addr, struct page **pages, in __pcpu_map_pages() argument
196 PAGE_KERNEL, pages); in __pcpu_map_pages()
200 * pcpu_map_pages - map pages into a pcpu_chunk
202 * @pages: pages array containing pages to be mapped
206 * For each cpu, map pages [@page_start,@page_end) into @chunk. The
214 struct page **pages, int page_start, int page_end) in pcpu_map_pages() argument
221 &pages[pcpu_page_idx(cpu, page_start)], in pcpu_map_pages()
227 pcpu_set_page_chunk(pages[pcpu_page_idx(cpu, i)], in pcpu_map_pages()
248 * Pages [@page_start,@page_end) of @chunk have been mapped. Flush
269 * For each cpu, populate and map pages [@page_start,@page_end) into
278 struct page **pages; in pcpu_populate_chunk() local
280 pages = pcpu_get_pages(); in pcpu_populate_chunk()
281 if (!pages) in pcpu_populate_chunk()
284 if (pcpu_alloc_pages(chunk, pages, page_start, page_end, gfp)) in pcpu_populate_chunk()
287 if (pcpu_map_pages(chunk, pages, page_start, page_end)) { in pcpu_populate_chunk()
288 pcpu_free_pages(chunk, pages, page_start, page_end); in pcpu_populate_chunk()
302 * For each cpu, depopulate and unmap pages [@page_start,@page_end)
311 struct page **pages; in pcpu_depopulate_chunk() local
315 * successful population attempt so the temp pages array must in pcpu_depopulate_chunk()
318 pages = pcpu_get_pages(); in pcpu_depopulate_chunk()
319 BUG_ON(!pages); in pcpu_depopulate_chunk()
324 pcpu_unmap_pages(chunk, pages, page_start, page_end); in pcpu_depopulate_chunk()
328 pcpu_free_pages(chunk, pages, page_start, page_end); in pcpu_depopulate_chunk()