*参照元 [#e49125f1] #backlinks *説明 [#sa8fae00] -パス: [[linux-4.4.1/mm/page_alloc.c]] -FIXME: これは何? --説明 **引数 [#m50fc010] -struct page *page -- --[[linux-4.4.1/page]] -unsigned int order -- -gfp_t gfp_flags -- --[[linux-4.4.1/gfp_t]] -int alloc_flags -- **返り値 [#bcb59d89] -int -- **参考 [#eaa58ae4] *実装 [#z2aa694f] static int prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags, int alloc_flags) { int i; for (i = 0; i < (1 << order); i++) { struct page *p = page + i; if (unlikely(check_new_page(p))) return 1; } - --[[linux-4.4.1/unlikely()]] --[[linux-4.4.1/check_new_page()]] set_page_private(page, 0); set_page_refcounted(page); - --[[linux-4.4.1/set_page_private()]] --[[linux-4.4.1/set_page_refcounted()]] arch_alloc_page(page, order); kernel_map_pages(page, 1 << order, 1); kasan_alloc_pages(page, order); - --[[linux-4.4.1/arch_alloc_page()]] --[[linux-4.4.1/kernel_map_pages()]] --[[linux-4.4.1/kasan_alloc_pages()]] if (gfp_flags & __GFP_ZERO) for (i = 0; i < (1 << order); i++) clear_highpage(page + i); - --[[linux-4.4.1/__GFP_ZERO]] --[[linux-4.4.1/clear_highpage()]] if (order && (gfp_flags & __GFP_COMP)) prep_compound_page(page, order); - --[[linux-4.4.1/__GFP_COMP]] --[[linux-4.4.1/prep_compound_page()]] set_page_owner(page, order, gfp_flags); - --[[linux-4.4.1/set_page_owner()]] /* * page is set pfmemalloc when ALLOC_NO_WATERMARKS was necessary to * allocate the page. The expectation is that the caller is taking * steps that will free more memory. The caller should avoid the page * being used for !PFMEMALLOC purposes. */ if (alloc_flags & ALLOC_NO_WATERMARKS) set_page_pfmemalloc(page); else clear_page_pfmemalloc(page); - --[[linux-4.4.1/set_page_pfmemalloc()]] --[[linux-4.4.1/clear_page_pfmemalloc()]] return 0; } *コメント [#e4e0cfdb]