freebsd-skq/sys
Edward Tomasz Napierala 3394d4239b cam: allocate CCBs from UMA for SCSI and ATA IO
This patch makes it possible for CAM to use small CCBs allocated
from an periph-specific UMA zone instead of the usual, huge ones.
The end result is that CCBs issued via da(4) take 544B (size of
ccb_scsiio) instead of the usual 2kB (size of 'union ccb', ~1.5kB,
rounded up by malloc(9)).  For ATA it's 272B.  We waste less
memory, we avoid zeroing the unused 1kB, and it should be easier
to allocate those CCBs in low memory conditions.  It should also
be possible to use uma_zone_reserve(9) to improve behaviour
in low memory conditions even further.

Note that this does not change the size, or the layout, of CCBs
as such.  CCBs get allocated in various different ways, in particular
on the stack, and I don't want to redo all that.  Instead, this
provides an opt-in mechanism for the periph to declare "my start()
callback is fine with receiving a CCB allocated from this UMA zone".
In other words, most of the code works exactly as it used to; the
change only happens to IOs issued by xpt_run_allockq(), which
is - conveniently - pretty much all that matters for performance.

The reason for doing it this way is that it's pretty small, localized
change, and can be implemented gradually and iteratively: take a
periph, make sure its start() callback only casts the CCBs it takes
to a particular type of CCB, for example ccb_scsiio, and that it only
casts CCBs returned by cam_periph_getccb() to that type, then add UMA
zone for that size, and declare it safe to XPT.

This is disabled by default.  Set 'kern.cam.ada.enable_uma_ccbs=1'
and 'kern.cam.da.enable_uma_ccbs=1' tunables to enable it.  Testing
is welcome; I will flip the default to enable in two weeks from now.

Reviewed By:	imp
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D28674
2021-05-15 12:03:49 +01:00
..
amd64 regen syscall files after d51198d63b63 2021-05-13 14:09:58 -04:00
arm regen syscall files after d51198d63b63 2021-05-13 14:09:58 -04:00
arm64 qoriq_dw_pci: disable LS1028A support 2021-05-14 10:50:17 +02:00
bsm
cam cam: allocate CCBs from UMA for SCSI and ATA IO 2021-05-15 12:03:49 +01:00
cddl fbt: Remove some handling for multiple CTF containers 2021-04-02 17:49:13 -04:00
compat regen syscall files after d51198d63b63 2021-05-13 14:09:58 -04:00
conf Add LS1028A clockgen driver 2021-05-07 03:48:53 +02:00
contrib zfs: restore copyright disclaimer change from 4b84b4cca 2021-04-26 22:16:50 +02:00
crypto ossl: Don't encryt/decrypt too much data for chacha20. 2021-04-01 15:49:07 -07:00
ddb fix style nit: space after if 2021-05-05 15:26:09 -06:00
dev cxgbei: Handle target transfers with excess unsolicited data. 2021-05-14 12:21:34 -07:00
dts arm64: rockchip: Add some DTSO to disable sd/mmc 2021-05-13 18:15:31 +02:00
fs tmpfs: dynamically register tmpfs pager 2021-05-13 20:13:34 +03:00
gdb gdb: report specific stop reason for watchpoints 2021-03-30 11:36:41 -03:00
geom gmultipath: make physpath distinct from the underlying providers' 2021-05-06 12:32:27 -06:00
gnu Remove the old dts imported tree. 2021-01-15 20:09:55 +01:00
i386 regen syscall files after d51198d63b63 2021-05-13 14:09:58 -04:00
isa Remove more remnants of sio(4) 2021-04-07 14:33:02 -04:00
kern vfs: add missing atomic conversion to writecount adjustment 2021-05-14 17:42:05 +02:00
kgssapi opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
libkern Use '.arch_extension crc' in the arm64 crc32 code 2021-05-06 07:42:35 +00:00
mips OCF: Remove support for asymmetric cryptographic operations. 2021-04-12 14:28:43 -07:00
modules modules: Only build sdhci_fdt for arm and arm64 2021-05-13 20:23:59 +02:00
net Fix a use after free in update_rtm_from_rc(). 2021-05-14 16:06:41 +00:00
net80211 net80211: prefix get_random_bytes() with net80211_ 2021-03-24 22:16:09 +00:00
netgraph netgraph/ng_bridge: Handle send errors during loop handling 2021-05-13 21:49:20 +02:00
netinet libalias: replace placeholder with static constant 2021-05-15 09:05:30 +02:00
netinet6 Fix mbuf leaks in various pru_send implementations 2021-05-12 13:00:09 -04:00
netipsec Add missing sockaddr length and family validation to various protocols 2021-05-03 13:35:19 -04:00
netpfil pf: Support killing 'matching' states 2021-05-07 22:13:31 +02:00
netsmb
nfs Fix panic when using BOOTP to resolve root path. 2021-03-28 14:02:40 -05:00
nfsclient nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nfsserver nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nlm
ofed Add missing sockaddr length and family validation to various protocols 2021-05-03 13:35:19 -04:00
opencrypto cryptodev: Fix some input validation bugs 2021-05-11 17:36:12 -04:00
powerpc powerpc/radix pmap: Convert stat counters from ulongs to counters 2021-05-10 21:26:14 -05:00
riscv riscv: Remove old qemu compatibility code 2021-04-27 16:22:04 -05:00
rpc nfsd: fix a NFSv4.1 Linux client mount stuck in CLOSE_WAIT 2021-04-27 15:32:35 -07:00
security tcp_input/syncache: acquire only read lock on PCB for SYN,!ACK packets 2021-04-12 08:25:31 -07:00
sys hwpmc: fix PMC_CPU_LAST 2021-05-13 16:02:59 -03:00
teken
tests Revise FIB lookups per second benchmarking routines. 2021-05-05 12:28:17 +02:00
tools makesyscalls.lua: improve generated file style(9) compliance 2021-05-13 13:59:25 -04:00
ufs b_vflags update requries bufobj lock 2021-04-15 15:47:42 +03:00
vm tmpfs: dynamically register tmpfs pager 2021-05-13 20:13:34 +03:00
x86 stack(9): Disable KASAN in stack_capture() 2021-05-07 14:31:08 -04:00
xdr
xen xen: move x86-specific xen_vector_callback_enabled to sys/x86 2021-03-15 14:20:21 +01:00
Makefile