From nobody Wed Aug 17 18:52:20 2022 X-Original-To: dev-commits-src-all@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 4M7HFK0Yjyz4YxP7; Wed, 17 Aug 2022 18:52:21 +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 4M7HFJ6wWjz4CYw; Wed, 17 Aug 2022 18:52:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660762341; 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=8Y/SWqLys2QSzLMLJAPF3V7h4s269cw8RmoxgnBenlI=; b=dRFZbBc1J40mSufC2QiEOzpNqBHklLAnz1DF3Cr9dPv7zXQpZ89eHdoYR/7pXCokoydwi8 pBOvgJ4xXE83NVCCm7snbgABDhNVG+5EAsullPto5pY8mRsyoABYQ2njbdPIOEIELAsRj2 SAFfH9YtU4NO/jJmsGo03FM+6coPnpWMwtESNzV9C+SZ12Vq8ADUpE8Yz7ztLonFOfLTim ShnjyZuzU1c91CNHpXee67OqtrkWOZzbjhQZmIUA4cSI1KFzkP3PMRTI1sWORGNb1xWf30 uwMw1YRiBPCZaaARQ3TVEWmrtb/+gNpy63gSABaDfQkOqRkt85RB6v9Z+ETNSQ== 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 4M7HFJ5JV9z10sx; Wed, 17 Aug 2022 18:52:20 +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 27HIqKoW013088; Wed, 17 Aug 2022 18:52:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27HIqKbY013087; Wed, 17 Aug 2022 18:52:20 GMT (envelope-from git) Date: Wed, 17 Aug 2022 18:52:20 GMT Message-Id: <202208171852.27HIqKbY013087@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 1922eb3e9c23 - main - protosw: retire pr_slowtimo and pr_fasttimo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1922eb3e9c23522ed323d022bac8456bf08b97cf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660762341; 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=8Y/SWqLys2QSzLMLJAPF3V7h4s269cw8RmoxgnBenlI=; b=Xe4+boroq5rizGBokFz5qbqX+IdETSM4Zff+QFjnZ1BGsuhiXgv/p0GtlmafItaBG6pbdF iPodLakFtR1RpZObn5MGQHrZA0xhrE+95HdPZsGYk9/gFhLosAPTapPAhEcbsVcPcpxv2f sS4Ppepqxl/DdVUR046SupCytn/aFIucqecM1c+UqY5SR/n6yamUppYvidqib2i7V2ai7U 3qGLI1a7BnZt6dM+CM4pHsFOF9GGI/4SLMKtWjqfsumOqkmA8rvrwiO4zofMJq+n9aPpQq QAJcvCvHJh66SQ690NFGpZOjYTV6+VDWLwmeWet4rzFnw3obbhhqBxYMDa8o+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660762341; a=rsa-sha256; cv=none; b=vv4lALWGPTlxJNUA7Mz912s2N+jz5AFqwYiChq3VAdI02YlaZ9v0RIpFWOusmpRmUZtm9N yP9mhoPbG/+9l0s6SbQcrYiFQM/ZxpmjDPANgXz++oYqj/ju4euvERTN6dme0bWJvYi2CJ okNYhj3q/HXUva1zQB4MTVKkriH1zlfeBY6XFq68MpRTJK+EaJLLBMiGSyXKPA3PmMT677 Cb8y3Bg7gr0bloeeM6I8SQ3/cEeTPSGi57pWEkHyBDmzW7Ly0AYO+PJPqQKQiFwPAPmlfe PxnxYonQVJz0k5UxAgb9M6Y20CizTNc7L718lc19ixtsnPivZIpNZgEFHFY5AA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1922eb3e9c23522ed323d022bac8456bf08b97cf commit 1922eb3e9c23522ed323d022bac8456bf08b97cf Author: Gleb Smirnoff AuthorDate: 2022-08-17 18:50:31 +0000 Commit: Gleb Smirnoff CommitDate: 2022-08-17 18:50:31 +0000 protosw: retire pr_slowtimo and pr_fasttimo They were useful many years ago, when the callwheel was not efficient, and the kernel tried to have as little callout entries scheduled as possible. Reviewed by: tuexen, melifaro Differential revision: https://reviews.freebsd.org/D36163 --- sys/kern/uipc_debug.c | 2 -- sys/kern/uipc_domain.c | 75 -------------------------------------------------- sys/net/route.h | 3 -- sys/sys/protosw.h | 11 -------- 4 files changed, 91 deletions(-) diff --git a/sys/kern/uipc_debug.c b/sys/kern/uipc_debug.c index b47ae71c84d9..5f96850431a0 100644 --- a/sys/kern/uipc_debug.c +++ b/sys/kern/uipc_debug.c @@ -317,8 +317,6 @@ db_print_protosw(struct protosw *pr, const char *prname, int indent) db_printf("pr_ctloutput: %p ", pr->pr_ctloutput); db_print_indent(indent); - db_printf("pr_fasttimo: %p ", pr->pr_fasttimo); - db_printf("pr_slowtimo: %p ", pr->pr_slowtimo); db_printf("pr_drain: %p\n", pr->pr_drain); } diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 2edd79657d03..20e7c87a6c20 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -71,20 +71,6 @@ static void domainfinalize(void *); SYSINIT(domainfin, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, domainfinalize, NULL); -static struct callout pffast_callout; -static struct callout pfslow_callout; - -static void pffasttimo(void *); -static void pfslowtimo(void *); - -static struct rmlock pftimo_lock; -RM_SYSINIT(pftimo_lock, &pftimo_lock, "pftimo"); - -static LIST_HEAD(, protosw) pffast_list = - LIST_HEAD_INITIALIZER(pffast_list); -static LIST_HEAD(, protosw) pfslow_list = - LIST_HEAD_INITIALIZER(pfslow_list); - struct domain *domains; /* registered protocol domains */ int domain_init_status = 0; static struct mtx dom_mtx; /* domain list lock */ @@ -192,12 +178,6 @@ domain_init(void *arg) for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) { pr_usrreqs_init(pr); - rm_wlock(&pftimo_lock); - if (pr->pr_fasttimo != NULL) - LIST_INSERT_HEAD(&pffast_list, pr, pr_fasttimos); - if (pr->pr_slowtimo != NULL) - LIST_INSERT_HEAD(&pfslow_list, pr, pr_slowtimos); - rm_wunlock(&pftimo_lock); } /* @@ -270,9 +250,6 @@ domaininit(void *dummy) if (max_linkhdr < 16) /* XXX */ max_linkhdr = 16; - callout_init(&pffast_callout, 1); - callout_init(&pfslow_callout, 1); - mtx_lock(&dom_mtx); KASSERT(domain_init_status == 0, ("domaininit called too late!")); domain_init_status = 1; @@ -288,9 +265,6 @@ domainfinalize(void *dummy) KASSERT(domain_init_status == 1, ("domainfinalize called too late!")); domain_init_status = 2; mtx_unlock(&dom_mtx); - - callout_reset(&pffast_callout, 1, pffasttimo, NULL); - callout_reset(&pfslow_callout, 1, pfslowtimo, NULL); } struct domain * @@ -403,12 +377,6 @@ pf_proto_register(int family, struct protosw *npr) bcopy(npr, fpr, sizeof(*fpr)); pr_usrreqs_init(fpr); - rm_wlock(&pftimo_lock); - if (fpr->pr_fasttimo != NULL) - LIST_INSERT_HEAD(&pffast_list, fpr, pr_fasttimos); - if (fpr->pr_slowtimo != NULL) - LIST_INSERT_HEAD(&pfslow_list, fpr, pr_slowtimos); - rm_wunlock(&pftimo_lock); /* Job is done, no more protection required. */ mtx_unlock(&dom_mtx); @@ -461,21 +429,12 @@ pf_proto_unregister(int family, int protocol, int type) return (EPROTONOSUPPORT); } - rm_wlock(&pftimo_lock); - if (dpr->pr_fasttimo != NULL) - LIST_REMOVE(dpr, pr_fasttimos); - if (dpr->pr_slowtimo != NULL) - LIST_REMOVE(dpr, pr_slowtimos); - rm_wunlock(&pftimo_lock); - /* De-orbit the protocol and make the slot available again. */ dpr->pr_type = 0; dpr->pr_domain = dp; dpr->pr_protocol = PROTO_SPACER; dpr->pr_flags = 0; dpr->pr_ctloutput = NULL; - dpr->pr_fasttimo = NULL; - dpr->pr_slowtimo = NULL; dpr->pr_drain = NULL; dpr->pr_usrreqs = &nousrreqs; @@ -484,37 +443,3 @@ pf_proto_unregister(int family, int protocol, int type) return (0); } - -static void -pfslowtimo(void *arg) -{ - struct rm_priotracker tracker; - struct epoch_tracker et; - struct protosw *pr; - - rm_rlock(&pftimo_lock, &tracker); - NET_EPOCH_ENTER(et); - LIST_FOREACH(pr, &pfslow_list, pr_slowtimos) { - (*pr->pr_slowtimo)(); - } - NET_EPOCH_EXIT(et); - rm_runlock(&pftimo_lock, &tracker); - callout_reset(&pfslow_callout, hz / PR_SLOWHZ, pfslowtimo, NULL); -} - -static void -pffasttimo(void *arg) -{ - struct rm_priotracker tracker; - struct epoch_tracker et; - struct protosw *pr; - - rm_rlock(&pftimo_lock, &tracker); - NET_EPOCH_ENTER(et); - LIST_FOREACH(pr, &pffast_list, pr_fasttimos) { - (*pr->pr_fasttimo)(); - } - NET_EPOCH_EXIT(et); - rm_runlock(&pftimo_lock, &tracker); - callout_reset(&pffast_callout, hz / PR_FASTHZ, pffasttimo, NULL); -} diff --git a/sys/net/route.h b/sys/net/route.h index 348ba16d6e88..87cbbbf1d83d 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -95,11 +95,8 @@ struct rt_metrics { /* * rmx_rtt and rmx_rttvar are stored as microseconds; - * RTTTOPRHZ(rtt) converts to a value suitable for use - * by a protocol slowtimo counter. */ #define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ -#define RTTTOPRHZ(r) ((r) / (RTM_RTTUNIT / PR_SLOWHZ)) /* lle state is exported in rmx_state rt_metrics field */ #define rmx_state rmx_weight diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 33f80a18cafd..6e46f40c8ad7 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -52,8 +52,6 @@ struct sockopt; * Each protocol has a handle initializing one of these structures, * which is used for protocol-protocol and system-protocol communication. * - * Thereafter it is called every 200ms through the pr_fasttimo entry and - * every 500ms through the pr_slowtimo for timer based actions. * The system will call the pr_drain entry if it is low on space and * this should throw away any non-critical data. * @@ -67,8 +65,6 @@ struct uio; /* USE THESE FOR YOUR PROTOTYPES ! */ typedef int pr_ctloutput_t(struct socket *, struct sockopt *); -typedef void pr_fasttimo_t(void); -typedef void pr_slowtimo_t(void); typedef void pr_drain_t(void); typedef void pr_abort_t(struct socket *); typedef int pr_accept_t(struct socket *, struct sockaddr **); @@ -121,19 +117,12 @@ struct protosw { /* protocol-protocol hooks */ pr_ctloutput_t *pr_ctloutput; /* control output (from above) */ /* utility hooks */ - pr_fasttimo_t *pr_fasttimo; /* fast timeout (200ms) */ - pr_slowtimo_t *pr_slowtimo; /* slow timeout (500ms) */ pr_drain_t *pr_drain; /* flush any excess space possible */ struct pr_usrreqs *pr_usrreqs; /* user-protocol hook */ - LIST_ENTRY(protosw) pr_fasttimos; - LIST_ENTRY(protosw) pr_slowtimos; }; /*#endif*/ -#define PR_SLOWHZ 2 /* 2 slow timeouts per second */ -#define PR_FASTHZ 5 /* 5 fast timeouts per second */ - /* * This number should be defined again within each protocol family to avoid * confusion.