Skip to contentSkip to conversation

New memory allocation API

DISCUSSION Leon Romanovsky 1 participant 1 message Feb 26 InfiniBand

lore
Share & tools
lore
#0 lore raw

Hi,

Please be aware that v7.0-rc1 has two commits:
bf4afc53b77a ("Convert 'alloc_obj' family to use the new default GFP_KERNEL argument") 69050f8d6d07 ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types")

Which changes old and well known kmalloc*() calls to kmalloc_obj():

Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)

Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning "TYPE *".

Thanks