diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2020-11-28 12:12:51 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2020-11-28 12:12:51 +0000 |
commit | cd8537910406e68d4719136a5b0cf6d23bb1b23b (patch) | |
tree | 7859126225cf7d9249711825e217dceba9857d59 /sys/dev/flash | |
parent | 1b9c78611d9de31ed2f942552549f2b6f7891185 (diff) | |
download | src-cd8537910406e68d4719136a5b0cf6d23bb1b23b.tar.gz src-cd8537910406e68d4719136a5b0cf6d23bb1b23b.zip |
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
Notes
Notes:
svn path=/head/; revision=368124
Diffstat (limited to 'sys/dev/flash')
-rw-r--r-- | sys/dev/flash/cqspi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/flash/cqspi.c b/sys/dev/flash/cqspi.c index 4c2bc1a75bc9..54752792798d 100644 --- a/sys/dev/flash/cqspi.c +++ b/sys/dev/flash/cqspi.c @@ -721,9 +721,9 @@ cqspi_attach(device_t dev) return (ENXIO); } - xdma_prep_sg(sc->xchan_tx, TX_QUEUE_SIZE, MAXPHYS, 8, 16, 0, + xdma_prep_sg(sc->xchan_tx, TX_QUEUE_SIZE, maxphys, 8, 16, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR); - xdma_prep_sg(sc->xchan_rx, TX_QUEUE_SIZE, MAXPHYS, 8, 16, 0, + xdma_prep_sg(sc->xchan_rx, TX_QUEUE_SIZE, maxphys, 8, 16, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR); cqspi_init(sc); |