aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2025-10-14 14:17:23 +0200
committerVlastimil Babka <vbabka@suse.cz>2025-11-23 12:30:40 +0100
commit48233291461b0539d798d00aaacccf1b3b163102 (patch)
tree5012c4f3daec84c13e15eb47d3bc6fffdc120a6d /mm
parent07723a41eee9525a90d027f7ca49d33fcd47e775 (diff)
downloadtip-48233291461b0539d798d00aaacccf1b3b163102.tar.gz
mempool: clarify behavior of mempool_alloc_preallocated()
The documentation of that function promises to never sleep. However on PREEMPT_RT a spinlock_t might in fact sleep. Reword the documentation so users can predict its behavior better. mempool could also replace spinlock_t with raw_spinlock_t which doesn't sleep even on PREEMPT_RT but that would take away the improved preemptibility of sleeping locks. Link: https://lkml.kernel.org/r/20251014-mempool-doc-v1-1-bc9ebf169700@linutronix.de Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Christoph Lameter <cl@gentwo.org> Cc: David Rientjes <rientjes@google.com> Cc: Roman Gushchin <roman.gushchin@linux.dev> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: "Vishal Moola (Oracle)" <vishal.moola@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm')
-rw-r--r--mm/mempool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/mempool.c b/mm/mempool.c
index efb383a94a28b4..bb596cac57ffea 100644
--- a/mm/mempool.c
+++ b/mm/mempool.c
@@ -576,8 +576,8 @@ EXPORT_SYMBOL(mempool_alloc_noprof);
* @pool: pointer to the memory pool
*
* This function is similar to mempool_alloc(), but it only attempts allocating
- * an element from the preallocated elements. It does not sleep and immediately
- * returns if no preallocated elements are available.
+ * an element from the preallocated elements. It only takes a single spinlock_t
+ * and immediately returns if no preallocated elements are available.
*
* Return: pointer to the allocated element or %NULL if no elements are
* available.