提交 235e3bfc 编写于 作者: M Matthew Wilcox (Oracle) 提交者: Zheng Zengkai

mm/mempolicy: rewrite alloc_pages_vma documentation

mainline inclusion
from mainline-5.13-rc1
commit eb350739
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I3ZVL2
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eb35073960510762dee417574589b7a8971c68ab

-------------------------------------------------

The current formatting doesn't quite work with kernel-doc.

Link: https://lkml.kernel.org/r/20210225150642.2582252-7-willy@infradead.orgSigned-off-by: NMatthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: NMike Rapoport <rppt@linux.ibm.com>
Acked-by: NVlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit eb350739)
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
Reviewed-by: NTong Tiangen <tongtiangen@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 c34262ec
...@@ -2147,30 +2147,22 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order, ...@@ -2147,30 +2147,22 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
} }
/** /**
* alloc_pages_vma - Allocate a page for a VMA. * alloc_pages_vma - Allocate a page for a VMA.
* * @gfp: GFP flags.
* @gfp: * @order: Order of the GFP allocation.
* %GFP_USER user allocation. * @vma: Pointer to VMA or NULL if not available.
* %GFP_KERNEL kernel allocations, * @addr: Virtual address of the allocation. Must be inside @vma.
* %GFP_HIGHMEM highmem/user allocations, * @node: Which node to prefer for allocation (modulo policy).
* %GFP_FS allocation should not call back into a file system. * @hugepage: For hugepages try only the preferred node if possible.
* %GFP_ATOMIC don't sleep.
* *
* @order:Order of the GFP allocation. * Allocate a page for a specific address in @vma, using the appropriate
* @vma: Pointer to VMA or NULL if not available. * NUMA policy. When @vma is not NULL the caller must hold the mmap_lock
* @addr: Virtual Address of the allocation. Must be inside the VMA. * of the mm_struct of the VMA to prevent it from going away. Should be
* @node: Which node to prefer for allocation (modulo policy). * used for all allocations for pages that will be mapped into user space.
* @hugepage: for hugepages try only the preferred node if possible
* *
* This function allocates a page from the kernel page pool and applies * Return: The page on success or NULL if allocation fails.
* a NUMA policy associated with the VMA or the current process.
* When VMA is not NULL caller must read-lock the mmap_lock of the
* mm_struct of the VMA to prevent it from going away. Should be used for
* all allocations for pages that will be mapped into user space. Returns
* NULL when no page can be allocated.
*/ */
struct page * struct page *alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
unsigned long addr, int node, bool hugepage) unsigned long addr, int node, bool hugepage)
{ {
struct mempolicy *pol; struct mempolicy *pol;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册