diff mbox series

[v3,6/7] mm/mempolicy: Rewrite alloc_pages_vma documentation

Message ID 20210225150642.2582252-7-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series Rationalise __alloc_pages wrappers | expand

Commit Message

Matthew Wilcox Feb. 25, 2021, 3:06 p.m. UTC
The current formatting doesn't quite work with kernel-doc.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/mempolicy.c | 34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

Comments

Mike Rapoport Feb. 25, 2021, 6:42 p.m. UTC | #1
On Thu, Feb 25, 2021 at 03:06:41PM +0000, Matthew Wilcox (Oracle) wrote:
> The current formatting doesn't quite work with kernel-doc.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Acked-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  mm/mempolicy.c | 34 +++++++++++++---------------------
>  1 file changed, 13 insertions(+), 21 deletions(-)
> 
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 24c2100fccba..6d0fe85d4f8d 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -2153,30 +2153,22 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
>  }
>  
>  /**
> - * 	alloc_pages_vma	- Allocate a page for a VMA.
> - *
> - * 	@gfp:
> - *      %GFP_USER    user allocation.
> - *      %GFP_KERNEL  kernel allocations,
> - *      %GFP_HIGHMEM highmem/user allocations,
> - *      %GFP_FS      allocation should not call back into a file system.
> - *      %GFP_ATOMIC  don't sleep.
> + * alloc_pages_vma - Allocate a page for a VMA.
> + * @gfp: GFP flags.
> + * @order: Order of the GFP allocation.
> + * @vma: Pointer to VMA or NULL if not available.
> + * @addr: Virtual address of the allocation.  Must be inside @vma.
> + * @node: Which node to prefer for allocation (modulo policy).
> + * @hugepage: For hugepages try only the preferred node if possible.
>   *
> - *	@order:Order of the GFP allocation.
> - * 	@vma:  Pointer to VMA or NULL if not available.
> - *	@addr: Virtual Address of the allocation. Must be inside the VMA.
> - *	@node: Which node to prefer for allocation (modulo policy).
> - *	@hugepage: for hugepages try only the preferred node if possible
> + * Allocate a page for a specific address in @vma, using the appropriate
> + * NUMA policy.  When @vma is not NULL the caller must hold 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.
>   *
> - * 	This function allocates a page from the kernel page pool and applies
> - *	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.
> + * Return: The page on success or NULL if allocation fails.
>   */
> -struct page *
> -alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
> +struct page *alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
>  		unsigned long addr, int node, bool hugepage)
>  {
>  	struct mempolicy *pol;
> -- 
> 2.29.2
>
Vlastimil Babka March 19, 2021, 2:48 p.m. UTC | #2
On 2/25/21 4:06 PM, Matthew Wilcox (Oracle) wrote:
> The current formatting doesn't quite work with kernel-doc.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/mempolicy.c | 34 +++++++++++++---------------------
>  1 file changed, 13 insertions(+), 21 deletions(-)
> 
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 24c2100fccba..6d0fe85d4f8d 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -2153,30 +2153,22 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
>  }
>  
>  /**
> - * 	alloc_pages_vma	- Allocate a page for a VMA.
> - *
> - * 	@gfp:
> - *      %GFP_USER    user allocation.
> - *      %GFP_KERNEL  kernel allocations,
> - *      %GFP_HIGHMEM highmem/user allocations,
> - *      %GFP_FS      allocation should not call back into a file system.
> - *      %GFP_ATOMIC  don't sleep.
> + * alloc_pages_vma - Allocate a page for a VMA.
> + * @gfp: GFP flags.
> + * @order: Order of the GFP allocation.
> + * @vma: Pointer to VMA or NULL if not available.
> + * @addr: Virtual address of the allocation.  Must be inside @vma.
> + * @node: Which node to prefer for allocation (modulo policy).
> + * @hugepage: For hugepages try only the preferred node if possible.
>   *
> - *	@order:Order of the GFP allocation.
> - * 	@vma:  Pointer to VMA or NULL if not available.
> - *	@addr: Virtual Address of the allocation. Must be inside the VMA.
> - *	@node: Which node to prefer for allocation (modulo policy).
> - *	@hugepage: for hugepages try only the preferred node if possible
> + * Allocate a page for a specific address in @vma, using the appropriate
> + * NUMA policy.  When @vma is not NULL the caller must hold 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.
>   *
> - * 	This function allocates a page from the kernel page pool and applies
> - *	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.
> + * Return: The page on success or NULL if allocation fails.
>   */
> -struct page *
> -alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
> +struct page *alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
>  		unsigned long addr, int node, bool hugepage)
>  {
>  	struct mempolicy *pol;
>
diff mbox series

Patch

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 24c2100fccba..6d0fe85d4f8d 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2153,30 +2153,22 @@  static struct page *alloc_page_interleave(gfp_t gfp, unsigned order,
 }
 
 /**
- * 	alloc_pages_vma	- Allocate a page for a VMA.
- *
- * 	@gfp:
- *      %GFP_USER    user allocation.
- *      %GFP_KERNEL  kernel allocations,
- *      %GFP_HIGHMEM highmem/user allocations,
- *      %GFP_FS      allocation should not call back into a file system.
- *      %GFP_ATOMIC  don't sleep.
+ * alloc_pages_vma - Allocate a page for a VMA.
+ * @gfp: GFP flags.
+ * @order: Order of the GFP allocation.
+ * @vma: Pointer to VMA or NULL if not available.
+ * @addr: Virtual address of the allocation.  Must be inside @vma.
+ * @node: Which node to prefer for allocation (modulo policy).
+ * @hugepage: For hugepages try only the preferred node if possible.
  *
- *	@order:Order of the GFP allocation.
- * 	@vma:  Pointer to VMA or NULL if not available.
- *	@addr: Virtual Address of the allocation. Must be inside the VMA.
- *	@node: Which node to prefer for allocation (modulo policy).
- *	@hugepage: for hugepages try only the preferred node if possible
+ * Allocate a page for a specific address in @vma, using the appropriate
+ * NUMA policy.  When @vma is not NULL the caller must hold 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.
  *
- * 	This function allocates a page from the kernel page pool and applies
- *	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.
+ * Return: The page on success or NULL if allocation fails.
  */
-struct page *
-alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
+struct page *alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
 		unsigned long addr, int node, bool hugepage)
 {
 	struct mempolicy *pol;