HomeFreeBSD

LinuxKPI: make __kmalloc() play by the rules

Description

LinuxKPI: make __kmalloc() play by the rules

According to Documentation/core-api/dma-api.rst kmalloc() is supposd
to provide physically contiguous memory. [1]

In order to guarantee that allocations are contiguous even if using
PAGE_SIZE or larger check the size and use contigmalloc if needed.
This makes use of 9e6544dd6e02 (and following) allowing free(9) to
also work for contigmalloced memory.

Sponsored by: The FreeBSD Foundation
Pointed out by: jhb [1]
Reviewed by: jhb, emaste
Differential Revision: https://reviews.freebsd.org/D46656

(cherry picked from commit 19df0c5abcb9d4e951e610b6de98d4d8a00bd5f9)

Details

Provenance
bzAuthored on Sep 12 2024, 6:11 PM
Reviewer
jhb
Differential Revision
D46656: LinuxKPI: make __kmalloc() play by the rules
Parents
rG580c891f5add: malloc: extend malloc_usable_size() for contigmalloc
Branches
Unknown
Tags
Unknown