]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make MAXPHYS tunable. Bump MAXPHYS to 1M.
authorkib <kib@FreeBSD.org>
Sat, 28 Nov 2020 12:12:51 +0000 (12:12 +0000)
committerkib <kib@FreeBSD.org>
Sat, 28 Nov 2020 12:12:51 +0000 (12:12 +0000)
commitca7c13e470d1ba0e9e078284182ba06e821af265
tree7859126225cf7d9249711825e217dceba9857d59
parent21c5c4014c5af4f09699a9c839a0a43614f33a95
Make MAXPHYS tunable.  Bump MAXPHYS to 1M.

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
99 files changed:
sys/cam/ata/ata_da.c
sys/cam/cam_compat.c
sys/cam/cam_periph.c
sys/cam/cam_xpt.c
sys/cam/ctl/ctl_backend_block.c
sys/cam/mmc/mmc_da.c
sys/cam/nvme/nvme_da.c
sys/cam/scsi/scsi_cd.c
sys/cam/scsi/scsi_da.c
sys/cam/scsi/scsi_pass.c
sys/cam/scsi/scsi_sa.c
sys/cam/scsi/scsi_sg.c
sys/cam/scsi/scsi_target.c
sys/compat/linprocfs/linprocfs.c
sys/compat/linux/linux_ioctl.c
sys/conf/options
sys/contrib/openzfs/module/os/freebsd/zfs/vdev_geom.c
sys/contrib/openzfs/module/os/freebsd/zfs/zvol_os.c
sys/dev/ahci/ahci.c
sys/dev/ahci/ahci.h
sys/dev/ahci/ahciem.c
sys/dev/ata/ata-all.c
sys/dev/ata/ata-all.h
sys/dev/ata/ata-dma.c
sys/dev/firewire/sbp.c
sys/dev/flash/cqspi.c
sys/dev/isci/scil/sci_controller_constants.h
sys/dev/iscsi/iscsi.c
sys/dev/md/md.c
sys/dev/mfi/mfi.c
sys/dev/mpr/mpr.c
sys/dev/mps/mps.c
sys/dev/mpt/mpt.c
sys/dev/mpt/mpt.h
sys/dev/mrsas/mrsas.c
sys/dev/mvs/mvs.c
sys/dev/mvs/mvs.h
sys/dev/nvme/nvme.h
sys/dev/nvme/nvme_ctrlr.c
sys/dev/pms/freebsd/driver/ini/src/agdef.h
sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
sys/dev/sdhci/sdhci.c
sys/dev/siis/siis.c
sys/dev/siis/siis.h
sys/dev/sym/sym_conf.h
sys/dev/usb/storage/umass.c
sys/dev/virtio/block/virtio_blk.c
sys/dev/virtio/scsi/virtio_scsi.c
sys/dev/xen/blkback/blkback.c
sys/dev/xen/blkfront/blkfront.c
sys/fs/cd9660/cd9660_vfsops.c
sys/fs/ext2fs/ext2_vfsops.c
sys/fs/fuse/fuse_vfsops.c
sys/fs/msdosfs/msdosfs_vfsops.c
sys/fs/udf/udf_vfsops.c
sys/geom/cache/g_cache.c
sys/geom/eli/g_eli_integrity.c
sys/geom/geom_dev.c
sys/geom/geom_io.c
sys/geom/journal/g_journal.c
sys/geom/journal/g_journal.h
sys/geom/mirror/g_mirror.c
sys/geom/nop/g_nop.c
sys/geom/part/g_part_apm.c
sys/geom/part/g_part_gpt.c
sys/geom/part/g_part_ldm.c
sys/geom/raid/md_ddf.c
sys/geom/raid/md_promise.c
sys/geom/raid3/g_raid3.c
sys/geom/shsec/g_shsec.c
sys/geom/stripe/g_stripe.c
sys/geom/uzip/g_uzip.c
sys/geom/vinum/geom_vinum_var.h
sys/geom/virstor/g_virstor.c
sys/geom/virstor/g_virstor.h
sys/kern/kern_mib.c
sys/kern/kern_physio.c
sys/kern/kern_sendfile.c
sys/kern/subr_param.c
sys/kern/vfs_aio.c
sys/kern/vfs_bio.c
sys/kern/vfs_cluster.c
sys/kern/vfs_default.c
sys/mips/ingenic/jz4780_mmc.c
sys/net/if.c
sys/powerpc/mambo/mambo_disk.c
sys/powerpc/mpc85xx/fsl_sata.c
sys/sys/aio.h
sys/sys/buf.h
sys/sys/param.h
sys/sys/systm.h
sys/ufs/ffs/ffs_vfsops.c
sys/vm/swap_pager.c
sys/vm/vm_fault.c
sys/vm/vm_init.c
sys/vm/vm_map.h
sys/vm/vm_pager.c
sys/vm/vm_pager.h
sys/vm/vnode_pager.c