From nobody Fri Jan 21 01:59:39 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 190431955DC1; Fri, 21 Jan 2022 01:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jg2cr00Lpz4cfH; Fri, 21 Jan 2022 01:59:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642730380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B+BNtkcT4Uj+bebUm5VmsdGOqCgDN+7oyzw9GJ62SF8=; b=KXfergCR2eG4n/FtWr6H7jitdoxaA+5offuAu70dlbTUX6urHe/vcESDAVYiYVcfuSqG7X 61vQa55+u36TTZhAQTHzLxDziayn2C8xC/WJcdLv3ZJDp+crlT8Zz1AfMHkdqiWl704pUT ABva5EWkKONxoRy0/SOFL0HS6vJ2tbEMqw8L6AHLPjq4hwIjWg3ugmMDMUujaHAaeUc1uK f+xVcaAIEorUJ5iRkA+NXCnCpJiarvIrtSUDpFFjwXwKA4OIks93/VoMCN0SmfzdM4Kdq1 govydngemKmLfryMBNg+GOx33M9vHzbnjFnRco1Ieca0isTMEha4V+s6q2ohkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D513B1371F; Fri, 21 Jan 2022 01:59:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20L1xdj6060729; Fri, 21 Jan 2022 01:59:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20L1xdRK060728; Fri, 21 Jan 2022 01:59:39 GMT (envelope-from git) Date: Fri, 21 Jan 2022 01:59:39 GMT Message-Id: <202201210159.20L1xdRK060728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: d1bc23490194 - stable/13 - cam: Relax callouts precisions. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d1bc23490194bd5a441b26fa1409717c267861f0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642730380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B+BNtkcT4Uj+bebUm5VmsdGOqCgDN+7oyzw9GJ62SF8=; b=RQkFiQnSSNqPyDLL5KOOWq1MyBG4C255PoHR1wjM+Pmqmc0Fuarzdd1T8Cmp4JxlUzOJdk Hm/I+y7osXj28byv6L7sKNrgAWXexytGL5wwGtlG2vFtLlvXEfSboTqIKOqLuApmGbOZfx 3EOcvSmT+LZy+ynUcw/IgJgC0XquZW89x14VGd6R0sFjjFsCIz1Y/ZUvwCqBvOxVwUoC9M mNU55BKUA4tO1XBmnZRvY6I96f1TYppQNvStkzdv6xxlM8aDu/KipHrsWgqLdaHeDRkeq8 tZ74s/+neO5RkS50eNMGfQEvYc3mdbpARCxqkXb/4yRp7hbR95VfIpVDFHXubA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642730380; a=rsa-sha256; cv=none; b=mmXiv+vTzyU1AmSJcq0NJqTLa4NUDCxW7YB0mhVrJWHAqexwtFCyyZZc3oHgnKF2azRi1U /pqT3LxHtYMtX1JMxno7ov9PYEct8W48lHmReRYEV4Z3dBKX1BNZpcQWpAbCqvESXmZpzG 2P8JZyP2KVlQRQIckK+eCPlrPmslBPYP5wCOw/XX5Y2eBI1WQHG+sZRnJh9gHhj7IBKcyW frP0Lt9GPyfWnB0eXYgCGQ/jqmVZqF5VE5RcEVcTl/YCk+KfGqwNASHbU9GM+KOGcqSnli DAkPlFVmZ4MKQKFUtpeF8Uj4HYUC12ZCwoqSZtDvznQYBQwotf4Grf5VeHn8xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=d1bc23490194bd5a441b26fa1409717c267861f0 commit d1bc23490194bd5a441b26fa1409717c267861f0 Author: Alexander Motin AuthorDate: 2022-01-07 17:49:21 +0000 Commit: Alexander Motin CommitDate: 2022-01-21 01:59:34 +0000 cam: Relax callouts precisions. On large systems even relatively rare callouts may fire many times per second. This should allow them to aggregate better, since we do not require any precision when polling for media change, etc. MFC after: 2 weeks (cherry picked from commit 0e5c50bf60727a5a832da9ba9dac06c057307a76) --- sys/cam/ata/ata_da.c | 13 +++++++------ sys/cam/cam_xpt.c | 6 +++--- sys/cam/scsi/scsi_cd.c | 14 +++++++++----- sys/cam/scsi/scsi_da.c | 26 +++++++++++++++----------- sys/cam/scsi/scsi_enc.c | 4 ++-- 5 files changed, 36 insertions(+), 27 deletions(-) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 36d0416a65a4..d49ef81f6009 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -1937,9 +1937,9 @@ adaregister(struct cam_periph *periph, void *arg) * ordered tag to a device. */ callout_init_mtx(&softc->sendordered_c, cam_periph_mtx(periph), 0); - callout_reset(&softc->sendordered_c, - (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, - adasendorderedtag, softc); + callout_reset_sbt(&softc->sendordered_c, + SBT_1S / ADA_ORDEREDTAG_INTERVAL * ada_default_timeout, 0, + adasendorderedtag, softc, C_PREL(1)); if (ADA_RA >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD) { softc->state = ADA_STATE_RAHEAD; @@ -3505,10 +3505,11 @@ adasendorderedtag(void *arg) softc->flags &= ~ADA_FLAG_WAS_OTAG; } } + /* Queue us up again */ - callout_reset(&softc->sendordered_c, - (ada_default_timeout * hz) / ADA_ORDEREDTAG_INTERVAL, - adasendorderedtag, softc); + callout_schedule_sbt(&softc->sendordered_c, + SBT_1S / ADA_ORDEREDTAG_INTERVAL * ada_default_timeout, 0, + C_PREL(1)); } /* diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 678d8e0b4f3d..184a6b69b488 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -3030,7 +3030,7 @@ call_sim: } callout_reset_sbt(&dev->callout, - SBT_1MS * crs->release_timeout, 0, + SBT_1MS * crs->release_timeout, SBT_1MS, xpt_release_devq_timeout, dev, 0); dev->flags |= CAM_DEV_REL_TIMEOUT_PENDING; @@ -5079,8 +5079,8 @@ xpt_ch_done(void *arg) { callout_init(&xsoftc.boot_callout, 1); - callout_reset_sbt(&xsoftc.boot_callout, SBT_1MS * xsoftc.boot_delay, 0, - xpt_boot_delay, NULL, 0); + callout_reset_sbt(&xsoftc.boot_callout, SBT_1MS * xsoftc.boot_delay, + SBT_1MS, xpt_boot_delay, NULL, 0); } SYSINIT(xpt_hw_delay, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_ANY, xpt_ch_done, NULL); diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index 460b423e469e..b9d5d1a76b9c 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -745,9 +745,10 @@ cdregister(struct cam_periph *periph, void *arg) callout_init_mtx(&softc->mediapoll_c, cam_periph_mtx(periph), 0); if ((softc->flags & CD_FLAG_DISC_REMOVABLE) && (cgd->inq_flags & SID_AEN) == 0 && - cd_poll_period != 0) - callout_reset(&softc->mediapoll_c, cd_poll_period * hz, - cdmediapoll, periph); + cd_poll_period != 0) { + callout_reset_sbt(&softc->mediapoll_c, cd_poll_period * SBT_1S, + 0, cdmediapoll, periph, C_PREL(1)); + } xpt_schedule(periph, CAM_PRIORITY_DEV); return(CAM_REQ_CMP); @@ -3134,9 +3135,12 @@ cdmediapoll(void *arg) xpt_schedule(periph, CAM_PRIORITY_NORMAL); } } + /* Queue us up again */ - if (cd_poll_period != 0) - callout_schedule(&softc->mediapoll_c, cd_poll_period * hz); + if (cd_poll_period != 0) { + callout_schedule_sbt(&softc->mediapoll_c, + cd_poll_period * SBT_1S, 0, C_PREL(1)); + } } /* diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 034953494bf6..a5f0198468f5 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -2863,9 +2863,9 @@ daregister(struct cam_periph *periph, void *arg) * ordered tag to a device. */ callout_init_mtx(&softc->sendordered_c, cam_periph_mtx(periph), 0); - callout_reset(&softc->sendordered_c, - (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, - dasendorderedtag, periph); + callout_reset_sbt(&softc->sendordered_c, + SBT_1S / DA_ORDEREDTAG_INTERVAL * da_default_timeout, 0, + dasendorderedtag, periph, C_PREL(1)); cam_periph_unlock(periph); /* @@ -2990,9 +2990,10 @@ daregister(struct cam_periph *periph, void *arg) callout_init_mtx(&softc->mediapoll_c, cam_periph_mtx(periph), 0); if ((softc->flags & DA_FLAG_PACK_REMOVABLE) && (cgd->inq_flags & SID_AEN) == 0 && - da_poll_period != 0) - callout_reset(&softc->mediapoll_c, da_poll_period * hz, - damediapoll, periph); + da_poll_period != 0) { + callout_reset_sbt(&softc->mediapoll_c, da_poll_period * SBT_1S, + 0, damediapoll, periph, C_PREL(1)); + } xpt_schedule(periph, CAM_PRIORITY_DEV); @@ -6021,9 +6022,12 @@ damediapoll(void *arg) daschedule(periph); } } + /* Queue us up again */ - if (da_poll_period != 0) - callout_schedule(&softc->mediapoll_c, da_poll_period * hz); + if (da_poll_period != 0) { + callout_schedule_sbt(&softc->mediapoll_c, + da_poll_period * SBT_1S, 0, C_PREL(1)); + } } static void @@ -6208,9 +6212,9 @@ dasendorderedtag(void *arg) } /* Queue us up again */ - callout_reset(&softc->sendordered_c, - (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, - dasendorderedtag, periph); + callout_schedule_sbt(&softc->sendordered_c, + SBT_1S / DA_ORDEREDTAG_INTERVAL * da_default_timeout, 0, + C_PREL(1)); } /* diff --git a/sys/cam/scsi/scsi_enc.c b/sys/cam/scsi/scsi_enc.c index ad6c09c99f58..e01f613514fb 100644 --- a/sys/cam/scsi/scsi_enc.c +++ b/sys/cam/scsi/scsi_enc.c @@ -844,8 +844,8 @@ enc_daemon(void *arg) */ root_mount_rel(&enc->enc_rootmount); - callout_reset(&enc->status_updater, 60*hz, - enc_status_updater, enc); + callout_reset_sbt(&enc->status_updater, 60 * SBT_1S, 0, + enc_status_updater, enc, C_PREL(1)); cam_periph_sleep(enc->periph, enc->enc_daemon, PUSER, "idle", 0);