With mallocarray() we cannot guarantee that any size larger than
PAGE_SIZE will be contiguous. Switch to use the internal __kmalloc()
implementation which now does provide that guarantee.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential D46657
LinuxKPI: switch mallocarray to an lpi implementation using __kmalloc() bz on Sep 12 2024, 6:27 PM. Authored by Tags None Referenced Files
Details
Diff Detail
Event TimelineComment Actions Also change the (internal) mallocarray() calls in linux_compat.c to lkpi_mallocarray() Comment Actions I'm not a fan of this, mallocarray is a OpenBSD thing, not a Linux thing, I don't see why we should have an lkpi implementation. Comment Actions It's a helper function; because we do use mallocarray internally and it doesn't go by Linux guarantees on memory being physically contiguous in some cases. I can replace all the mallocarray calls directly with __kmalloc() but that just makes it harder to maintain in many places rather one. We can name this whatever we want it to be if you do not like the name... |