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.

mempool: improve kerneldoc comments

Use proper formatting, use full sentences and reduce some verbosity in
function parameter descriptions.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20251113084022.1255121-4-hch@lst.de
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

authored by

Christoph Hellwig and committed by
Vlastimil Babka
5c829783 e9939ceb

+22 -19
+22 -19
mm/mempool.c
··· 372 372 EXPORT_SYMBOL(mempool_resize); 373 373 374 374 /** 375 - * mempool_alloc - allocate an element from a specific memory pool 376 - * @pool: pointer to the memory pool which was allocated via 377 - * mempool_create(). 378 - * @gfp_mask: the usual allocation bitmask. 375 + * mempool_alloc - allocate an element from a memory pool 376 + * @pool: pointer to the memory pool 377 + * @gfp_mask: GFP_* flags. %__GFP_ZERO is not supported. 379 378 * 380 - * this function only sleeps if the alloc_fn() function sleeps or 381 - * returns NULL. Note that due to preallocation, this function 382 - * *never* fails when called from process contexts. (it might 383 - * fail if called from an IRQ context.) 384 - * Note: using __GFP_ZERO is not supported. 379 + * Allocate an element from @pool. This is done by first calling into the 380 + * alloc_fn supplied at pool initialization time, and dipping into the reserved 381 + * pool when alloc_fn fails to allocate an element. 385 382 * 386 - * Return: pointer to the allocated element or %NULL on error. 383 + * This function only sleeps if the alloc_fn callback sleeps, or when waiting 384 + * for elements to become available in the pool. 385 + * 386 + * Return: pointer to the allocated element or %NULL when failing to allocate 387 + * an element. Allocation failure can only happen when @gfp_mask does not 388 + * include %__GFP_DIRECT_RECLAIM. 387 389 */ 388 390 void *mempool_alloc_noprof(mempool_t *pool, gfp_t gfp_mask) 389 391 { ··· 458 456 459 457 /** 460 458 * mempool_alloc_preallocated - allocate an element from preallocated elements 461 - * belonging to a specific memory pool 462 - * @pool: pointer to the memory pool which was allocated via 463 - * mempool_create(). 459 + * belonging to a memory pool 460 + * @pool: pointer to the memory pool 464 461 * 465 - * This function is similar to mempool_alloc, but it only attempts allocating 462 + * This function is similar to mempool_alloc(), but it only attempts allocating 466 463 * an element from the preallocated elements. It does not sleep and immediately 467 464 * returns if no preallocated elements are available. 468 465 * ··· 493 492 EXPORT_SYMBOL(mempool_alloc_preallocated); 494 493 495 494 /** 496 - * mempool_free - return an element to the pool. 497 - * @element: pool element pointer. 498 - * @pool: pointer to the memory pool which was allocated via 499 - * mempool_create(). 495 + * mempool_free - return an element to a mempool 496 + * @element: pointer to element 497 + * @pool: pointer to the memory pool 500 498 * 501 - * this function only sleeps if the free_fn() function sleeps. 499 + * Returns @element to @pool if it needs replenishing, else frees it using 500 + * the free_fn callback in @pool. 501 + * 502 + * This function only sleeps if the free_fn callback sleeps. 502 503 */ 503 504 void mempool_free(void *element, mempool_t *pool) 504 505 {