Re: [PATCH] mm/slab: improve kmem_cache_alloc_bulk
"Vlastimil Babka (SUSE)" <[email protected]>
| Newsgroups | org.kernel.vger.io-uring,org.freedesktop.lists.dri-devel,org.kernel.vger.bpf,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.netdev,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
On 5/27/26 09:02, Christoph Hellwig wrote: > The kmem_cache_alloc_bulk return value is weird. It returns the number > of allocated objects, but that must always be 0 or the requested number > based on the implementations and the handling in the callers, but that > assumption is not actually documented anywhere, which confuses automated > review tools. > > Fix this by returning a bool if the allocation succeeded and adding a > kerneldoc comment explaining the API. > > Signed-off-by: Christoph Hellwig <[email protected]> Would 0 / -ENOMEM be more like what people would expect? I guess both that and bool are better than the current API.