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/firewire | |
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/firewire')
-rw-r--r-- | sys/dev/firewire/sbp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index 72fe6d9b4454..58e2086399d2 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -71,7 +71,7 @@ * because of CAM_SCSI2_MAXLUN in cam_xpt.c */ #define SBP_NUM_LUNS 64 -#define SBP_MAXPHYS MIN(MAXPHYS, (512*1024) /* 512KB */) +#define SBP_MAXPHYS (128 * 1024) #define SBP_DMA_SIZE PAGE_SIZE #define SBP_LOGIN_SIZE sizeof(struct sbp_login_res) #define SBP_QUEUE_LEN ((SBP_DMA_SIZE - SBP_LOGIN_SIZE) / sizeof(struct sbp_ocb)) |