Date: Fri, 24 Apr 2026 18:38:17 +0000 From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Scott Long <scottl@FreeBSD.org> Subject: git: cb78764d47db - main - cam: kern.cam.max_high_power tuneable / sysctl Message-ID: <69ebb899.22aad.5bac334@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=cb78764d47db973a1c9d08565143a1b1b7f17513 commit cb78764d47db973a1c9d08565143a1b1b7f17513 Author: Scott Long <scottl@FreeBSD.org> AuthorDate: 2026-04-24 18:31:29 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2026-04-24 18:32:46 +0000 cam: kern.cam.max_high_power tuneable / sysctl Create a tunable for the maxinum number of 'high power' commands to schedule, kern.cam.max_high_power. Default remains at 4. Differential Revision: https://reviews.freebsd.org/D56462 --- sys/cam/cam_xpt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 605f4d8c3cf0..0ae6adb8adf3 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -86,8 +86,8 @@ SDT_PROBE_DEFINE4(cam, , xpt, async__cb, "void *", "uint32_t", _Static_assert(XPT_PRINT_LEN <= XPT_PRINT_MAXLEN, "XPT_PRINT_LEN is too large"); /* - * This is the maximum number of high powered commands (e.g. start unit) - * that can be outstanding at a particular time. + * This sets a default for the the maximum number of high powered commands + * (e.g. start unit) that can be outstanding at a particular time. */ #ifndef CAM_MAX_HIGHPOWER #define CAM_MAX_HIGHPOWER 4 @@ -168,6 +168,9 @@ SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, &xsoftc.boot_delay, 0, "Bus registration wait time"); SYSCTL_UINT(_kern_cam, OID_AUTO, xpt_generation, CTLFLAG_RD, &xsoftc.xpt_generation, 0, "CAM peripheral generation count"); +SYSCTL_INT(_kern_cam, OID_AUTO, max_high_power, CTLFLAG_RWTUN, + &xsoftc.num_highpower, 0, + "Max number of high power commands to be issued at once"); struct cam_doneq { struct mtx_padalign cam_doneq_mtx; @@ -892,7 +895,10 @@ xpt_init(void *dummy) TAILQ_INIT(&xsoftc.xpt_busses); TAILQ_INIT(&xsoftc.ccb_scanq); STAILQ_INIT(&xsoftc.highpowerq); - xsoftc.num_highpower = CAM_MAX_HIGHPOWER; + + /* Fall back to a default if the kenv tunable isn't set */ + if (xsoftc.num_highpower == 0) + xsoftc.num_highpower = CAM_MAX_HIGHPOWER; mtx_init(&xsoftc.xpt_highpower_lock, "XPT highpower lock", NULL, MTX_DEF); xsoftc.xpt_taskq = taskqueue_create("CAM XPT task", M_WAITOK,home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69ebb899.22aad.5bac334>
