Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Christoph Hellwig and committed by
Vlastimil Babka
e9939ceb 0f2620ff

+10 -5
+10 -5
mm/page_alloc.c
··· 4982 4982 * @nr_pages: The number of pages desired in the array 4983 4983 * @page_array: Array to store the pages 4984 4984 * 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. 4987 4987 * 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. 4990 4991 * 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. 4992 4997 */ 4993 4998 unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid, 4994 4999 nodemask_t *nodemask, int nr_pages,