mirror of
https://github.com/opnsense/src.git
synced 2026-07-13 02:58:12 -04:00
Replace MAXPHYS by runtime variable maxphys. It is initialized from MAXPHYS by default, but can be also adjusted with the tunable kern.maxphys. Make b_pages[] array in struct buf flexible. Size b_pages[] for buffer cache buffers exactly to atop(maxbcachebuf) (currently it is sized to atop(MAXPHYS)), and b_pages[] for pbufs is sized to atop(maxphys) + 1. The +1 for pbufs allow several pbuf consumers, among them vmapbuf(), to use unaligned buffers still sized to maxphys, esp. when such buffers come from userspace (*). Overall, we save significant amount of otherwise wasted memory in b_pages[] for buffer cache buffers, while bumping MAXPHYS to desired high value. Eliminate all direct uses of the MAXPHYS constant in kernel and driver sources, except a place which initialize maxphys. Some random (and arguably weird) uses of MAXPHYS, e.g. in linuxolator, are converted straight. Some drivers, which use MAXPHYS to size embeded structures, get private MAXPHYS-like constant; their convertion is out of scope for this work. Changes to cam/, dev/ahci, dev/ata, dev/mpr, dev/mpt, dev/mvs, dev/siis, where either submitted by, or based on changes by mav. Suggested by: mav (*) Reviewed by: imp, mav, imp, mckusick, scottl (intermediate versions) Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27225 |
||
|---|---|---|
| .. | ||
| check_error.d | ||
| check_internal_locks.d | ||
| linux.c | ||
| linux.h | ||
| linux_common.c | ||
| linux_common.h | ||
| linux_dtrace.h | ||
| linux_dummy.c | ||
| linux_emul.c | ||
| linux_emul.h | ||
| linux_errno.c | ||
| linux_errno.h | ||
| linux_errno.inc | ||
| linux_event.c | ||
| linux_event.h | ||
| linux_file.c | ||
| linux_file.h | ||
| linux_fork.c | ||
| linux_futex.c | ||
| linux_futex.h | ||
| linux_getcwd.c | ||
| linux_ioctl.c | ||
| linux_ioctl.h | ||
| linux_ipc.c | ||
| linux_ipc.h | ||
| linux_ipc64.h | ||
| linux_mib.c | ||
| linux_mib.h | ||
| linux_misc.c | ||
| linux_misc.h | ||
| linux_mmap.c | ||
| linux_mmap.h | ||
| linux_persona.h | ||
| linux_signal.c | ||
| linux_signal.h | ||
| linux_socket.c | ||
| linux_socket.h | ||
| linux_stats.c | ||
| linux_sysctl.c | ||
| linux_sysproto.h | ||
| linux_time.c | ||
| linux_timer.c | ||
| linux_timer.h | ||
| linux_uid16.c | ||
| linux_util.c | ||
| linux_util.h | ||
| linux_vdso.c | ||
| linux_vdso.h | ||
| linux_videodev2_compat.h | ||
| linux_videodev_compat.h | ||
| stats_timing.d | ||
| trace_futexes.d | ||