Lines Matching defs:page
120 * contiguous multi-page chunks, a single chunk is optimal.
162 * Scatter ABD's use at least one page each, so sub-page allocations waste
164 * half of each page). Using linear ABD's for small allocations means that
170 * possible for them to actually waste more memory than scatter (one page per
183 * just a single zero'd page. This allows us to conserve memory by
184 * only using a single zero page for the scatterlist.
188 struct page;
195 static struct page *abd_zero_page = NULL;
237 abd_mark_zfs_page(struct page *page)
239 get_page(page);
240 SetPagePrivate(page);
241 set_page_private(page, ABD_FILE_CACHE_PAGE);
245 abd_unmark_zfs_page(struct page *page)
247 set_page_private(page, 0UL);
248 ClearPagePrivate(page);
249 put_page(page);
252 #define abd_mark_zfs_page(page)
253 #define abd_unmark_zfs_page(page)
275 struct page *page, *tmp_page = NULL;
297 page = alloc_pages_node(nid, order ? gfp_comp : gfp, order);
298 if (page == NULL) {
308 list_add_tail(&page->lru, &pages);
310 if ((nid != NUMA_NO_NODE) && (page_to_nid(page) != nid))
313 nid = page_to_nid(page);
328 list_for_each_entry_safe(page, tmp_page, &pages, lru) {
329 size_t sg_size = MIN(PAGESIZE << compound_order(page),
331 sg_set_page(sg, page, sg_size, 0);
332 abd_mark_zfs_page(page);
336 list_del(&page->lru);
349 * as a linear buffer. All single-page (4K) ABD's can be
350 * represented this way. Some multi-page ABD's can also be
352 * "chunk" (higher-order "page" which represents a power-of-2
354 * case for 2-page (8K) ABD's.
397 struct page *page;
412 while ((page = __page_cache_alloc(gfp)) == NULL) {
418 sg_set_page(sg, page, PAGESIZE, 0);
419 abd_mark_zfs_page(page);
447 struct page *page;
463 page = sg_page(sg);
464 abd_unmark_zfs_page(page);
465 order = compound_order(page);
466 __free_pages(page, order);
476 * Allocate scatter ABD of size SPA_MAXBLOCKSIZE, where each page in
701 /* When backed by user page unmap it */
721 abd_alloc_from_pages(struct page **pages, unsigned long offset, uint64_t size)
748 * as a linear buffer. All single-page (4K) ABD's constructed
749 * from a user page can be represented this way as long as the
750 * page is mapped to a virtual address. This allows us to
751 * apply an offset in to the mapped page.
967 * In the event the ABD is composed of a single user page from Direct
969 * of not being able to write protect the page and the contents of the
970 * page can be changed at any time by the user.
992 * In the event the ABD is composed of a single user page from Direct
995 * protect the user page and there is a risk the contents of the page
1067 * It yields the next page struct and data offset and size within it, without
1073 * struct page *. Its organised as a "head" page, followed by a series of
1081 * as-is. However, the head page has length covering itself and all the tail
1082 * pages. If the ABD chunk spans multiple pages, then we can use the head page
1085 * Before kernel 4.5 however, compound page heads were refcounted separately
1086 * from tail pages, such that moving back to the head page would require us to
1090 * page references on such ancient kernels, we disabled this special compound
1091 * page handling on kernels before 4.5, instead just using treating each page
1092 * within it as a regular PAGESIZE page (which it is). This is slightly less
1100 * handling, by defining the ABD_ITER_PAGE_SIZE(page) macro to understand
1109 #define ABD_ITER_PAGE_SIZE(page) \
1110 (PageCompound(page) ? page_size(page) : PAGESIZE)
1112 #define ABD_ITER_PAGE_SIZE(page) (PAGESIZE)
1125 struct page *page;
1129 * Find the page, and the start of the data within it. This is computed
1131 * virtual memory location, while scatter is referenced by page
1140 /* struct page for address */
1141 page = is_vmalloc_addr(paddr) ?
1144 /* offset of address within the page */
1149 /* current scatter page */
1150 page = nth_page(sg_page(aiter->iter_sg),
1153 /* position within page */
1158 if (PageTail(page)) {
1160 * If this is a compound tail page, move back to the head, and
1162 * larger amount of data from a single logical page, and so
1165 struct page *head = compound_head(page);
1166 doff += ((page - head) * PAGESIZE);
1167 page = head;
1171 ASSERT(page);
1174 * Compute the maximum amount of data we can take from this page. This
1176 * - the remaining space in the page
1178 * the entire page)
1182 dsize = MIN(ABD_ITER_PAGE_SIZE(page) - doff,
1189 aiter->iter_page = page;
1236 struct page *page;
1249 page = vmalloc_to_page(buf_ptr);
1251 page = virt_to_page(buf_ptr);
1255 * doesn't behave well when using 0-count page, this is a
1258 ASSERT3S(page_count(page), >, 0);
1260 if (bio_add_page(bio, page, size, offset) != size)
1318 struct page *pg;