Skip to content

Commit e9939ce

Browse files
Christoph Hellwigtehcaster
authored andcommitted
mm: improve kerneldoc comments for __alloc_pages_bulk
Describe the semantincs in more detail, as the filling empty slots in an array scheme is not quite obvious. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20251113084022.1255121-3-hch@lst.de Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
1 parent 0f2620f commit e9939ce

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

mm/page_alloc.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4982,13 +4982,18 @@ static inline bool prepare_alloc_pages(gfp_t gfp_mask, unsigned int order,
49824982
* @nr_pages: The number of pages desired in the array
49834983
* @page_array: Array to store the pages
49844984
*
4985-
* This is a batched version of the page allocator that attempts to
4986-
* allocate nr_pages quickly. Pages are added to the page_array.
4985+
* This is a batched version of the page allocator that attempts to allocate
4986+
* @nr_pages quickly. Pages are added to @page_array.
49874987
*
4988-
* Note that only NULL elements are populated with pages and nr_pages
4989-
* is the maximum number of pages that will be stored in the array.
4988+
* Note that only the elements in @page_array that were cleared to %NULL on
4989+
* entry are populated with newly allocated pages. @nr_pages is the maximum
4990+
* number of pages that will be stored in the array.
49904991
*
4991-
* Returns the number of pages in the array.
4992+
* Returns the number of pages in @page_array, including ones already
4993+
* allocated on entry. This can be less than the number requested in @nr_pages,
4994+
* but all empty slots are filled from the beginning. I.e., if all slots in
4995+
* @page_array were set to %NULL on entry, the slots from 0 to the return value
4996+
* - 1 will be filled.
49924997
*/
49934998
unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
49944999
nodemask_t *nodemask, int nr_pages,

0 commit comments

Comments
 (0)