opnsense-src/sys/compat
Olivier Certner 986edb19a4
LinuxKPI: Have kvzalloc() rely on kvmalloc(), not kmalloc()
Since commit 19df0c5abc ("LinuxKPI: make __kmalloc() play by the
rules"), kmalloc() systematically allocates contiguous physical memory,
as it should.  However, kvzalloc() was left defined in terms of
kmalloc(), which makes it allocate contiguous physical memory too.  This
is a too stringent restriction, as kvzalloc() is supposed to be a simple
page-zeroing wrapper around kvmalloc().

According to Linux's documentation ("memory-allocation.rst"), kvmalloc()
first tries to allocate contiguous memory, falling back to
non-contiguous one if that fails.  Thus, callers are already supposed to
deal with the possibility of non-contiguous memory being returned.

Reviewed by:    bz
Fixes:          19df0c5abc ("LinuxKPI: make __kmalloc() play by the rules")
MFC after:      10 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D51247
2025-07-13 15:46:49 +09:00
..
freebsd32 Regen. 2025-07-07 00:20:45 +03:00
ia32 sysent: retire unused SV_IA32 2025-06-03 23:59:30 +01:00
lindebugfs lindebugfs.c: Fix possible NULL dereference 2025-06-23 23:43:51 +02:00
linprocfs linprocfs: Correct sysfs /proc/<pid>/mountinfo entry 2025-03-10 11:12:36 -07:00
linsysfs linsysfs(5): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743 2023-08-18 13:12:02 +03:00
linux linux: Add inotify support 2025-07-04 14:42:34 +00:00
linuxkpi LinuxKPI: Have kvzalloc() rely on kvmalloc(), not kmalloc() 2025-07-13 15:46:49 +09:00
x86bios Deprecate contigfree(9) in favour of free(9) 2024-07-26 10:45:01 +00:00