diff mbox series

[v3,5/7] mm/mempolicy: Rewrite alloc_pages documentation

Message ID 20210225150642.2582252-6-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
Document alloc_pages() for both NUMA and non-NUMA cases as kernel-doc
doesn't care.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Michal Hocko <mhocko@suse.com>
---
 mm/mempolicy.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

Comments

Vlastimil Babka March 19, 2021, 2:47 p.m. UTC | #1
On 2/25/21 4:06 PM, Matthew Wilcox (Oracle) wrote:
> Document alloc_pages() for both NUMA and non-NUMA cases as kernel-doc
> doesn't care.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Acked-by: Mike Rapoport <rppt@linux.ibm.com>
> Acked-by: Michal Hocko <mhocko@suse.com>

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

> ---
>  mm/mempolicy.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index c71532b7e3f8..24c2100fccba 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -2245,19 +2245,18 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
>  EXPORT_SYMBOL(alloc_pages_vma);
>  
>  /**
> - * 	alloc_pages - Allocate pages.
> + * alloc_pages - Allocate pages.
> + * @gfp: GFP flags.
> + * @order: Power of two of number of pages to allocate.
>   *
> - *	@gfp:
> - *		%GFP_USER   user allocation,
> - *      	%GFP_KERNEL kernel allocation,
> - *      	%GFP_HIGHMEM highmem allocation,
> - *      	%GFP_FS     don't call back into a file system.
> - *      	%GFP_ATOMIC don't sleep.
> - *	@order: Power of two of allocation size in pages. 0 is a single page.
> + * Allocate 1 << @order contiguous pages.  The physical address of the
> + * first page is naturally aligned (eg an order-3 allocation will be aligned
> + * to a multiple of 8 * PAGE_SIZE bytes).  The NUMA policy of the current
> + * process is honoured when in process context.
>   *
> - *	Allocate a page from the kernel page pool.  When not in
> - *	interrupt context and apply the current process NUMA policy.
> - *	Returns NULL when no page can be allocated.
> + * Context: Can be called from any context, providing the appropriate GFP
> + * flags are used.
> + * Return: The page on success or NULL if allocation fails.
>   */
>  struct page *alloc_pages(gfp_t gfp, unsigned order)
>  {
>
diff mbox series

Patch

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index c71532b7e3f8..24c2100fccba 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2245,19 +2245,18 @@  alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma,
 EXPORT_SYMBOL(alloc_pages_vma);
 
 /**
- * 	alloc_pages - Allocate pages.
+ * alloc_pages - Allocate pages.
+ * @gfp: GFP flags.
+ * @order: Power of two of number of pages to allocate.
  *
- *	@gfp:
- *		%GFP_USER   user allocation,
- *      	%GFP_KERNEL kernel allocation,
- *      	%GFP_HIGHMEM highmem allocation,
- *      	%GFP_FS     don't call back into a file system.
- *      	%GFP_ATOMIC don't sleep.
- *	@order: Power of two of allocation size in pages. 0 is a single page.
+ * Allocate 1 << @order contiguous pages.  The physical address of the
+ * first page is naturally aligned (eg an order-3 allocation will be aligned
+ * to a multiple of 8 * PAGE_SIZE bytes).  The NUMA policy of the current
+ * process is honoured when in process context.
  *
- *	Allocate a page from the kernel page pool.  When not in
- *	interrupt context and apply the current process NUMA policy.
- *	Returns NULL when no page can be allocated.
+ * Context: Can be called from any context, providing the appropriate GFP
+ * flags are used.
+ * Return: The page on success or NULL if allocation fails.
  */
 struct page *alloc_pages(gfp_t gfp, unsigned order)
 {