From owner-dev-commits-src-main@freebsd.org Sat Sep 4 18:46:13 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28A9166A289; Sat, 4 Sep 2021 18:46:13 +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 4H23XP0kpYz3k8N; Sat, 4 Sep 2021 18:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 ED3B41CF23; Sat, 4 Sep 2021 18:46:12 +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 184IkCl0047994; Sat, 4 Sep 2021 18:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 184IkCHw047993; Sat, 4 Sep 2021 18:46:12 GMT (envelope-from git) Date: Sat, 4 Sep 2021 18:46:12 GMT Message-Id: <202109041846.184IkCHw047993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 312f5f8a4fb9 - main - altq: mark callouts as mpsafe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 312f5f8a4fb92c46b5499139b48cf525a4049243 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Sep 2021 18:46:13 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=312f5f8a4fb92c46b5499139b48cf525a4049243 commit 312f5f8a4fb92c46b5499139b48cf525a4049243 Author: Kristof Provost AuthorDate: 2021-09-04 12:18:45 +0000 Commit: Kristof Provost CommitDate: 2021-09-04 15:26:10 +0000 altq: mark callouts as mpsafe There's no reason to acquire the Giant lock while executing the ALTQ callouts. While here also remove a few backwards compatibility defines for long obsolete FreeBSD versions. Reviewed by: mav Suggested by: mav Differential Revision: https://reviews.freebsd.org/D31835 --- sys/net/altq/altq_subr.c | 4 +--- sys/net/altq/altq_var.h | 9 +-------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/net/altq/altq_subr.c b/sys/net/altq/altq_subr.c index 39f91c4daf63..32999b694bcb 100644 --- a/sys/net/altq/altq_subr.c +++ b/sys/net/altq/altq_subr.c @@ -908,9 +908,7 @@ EVENTHANDLER_DEFINE(cpufreq_post_change, tsc_freq_changed, NULL, static void init_machclk_setup(void) { -#if (__FreeBSD_version >= 600000) - callout_init(&tbr_callout, 0); -#endif + callout_init(&tbr_callout, 1); machclk_usepcc = 1; diff --git a/sys/net/altq/altq_var.h b/sys/net/altq/altq_var.h index f711e09334cb..6763fd972d7d 100644 --- a/sys/net/altq/altq_var.h +++ b/sys/net/altq/altq_var.h @@ -164,16 +164,9 @@ typedef u_long ioctlcmd_t; /* use callout */ #include -#if (__FreeBSD_version > 500000) -#define CALLOUT_INIT(c) callout_init((c), 0) -#else -#define CALLOUT_INIT(c) callout_init((c)) -#endif +#define CALLOUT_INIT(c) callout_init((c), 1) #define CALLOUT_RESET(c,t,f,a) callout_reset((c),(t),(f),(a)) #define CALLOUT_STOP(c) callout_stop((c)) -#if !defined(CALLOUT_INITIALIZER) && (__FreeBSD_version < 600000) -#define CALLOUT_INITIALIZER { { { NULL } }, 0, NULL, NULL, 0 } -#endif #define m_pktlen(m) ((m)->m_pkthdr.len)