From nobody Thu Jul 7 15:25:01 2022 X-Original-To: freebsd-hackers@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 0A0268D7208 for ; Thu, 7 Jul 2022 15:25:19 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4Lf0bK4LMGz3CP1 for ; Thu, 7 Jul 2022 15:25:17 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from sslproxy03.your-server.de ([88.198.220.132]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o9TNN-0008KG-6u for freebsd-hackers@freebsd.org; Thu, 07 Jul 2022 17:25:09 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o9TNN-000Mxg-DL for freebsd-hackers@freebsd.org; Thu, 07 Jul 2022 17:25:09 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 1563A4801CD for ; Thu, 7 Jul 2022 17:25:09 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id cTCNlpqPyFQD for ; Thu, 7 Jul 2022 17:25:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id BD4364801C9 for ; Thu, 7 Jul 2022 17:25:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BqXysfgfZatA for ; Thu, 7 Jul 2022 17:25:08 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 9C9274800C5 for ; Thu, 7 Jul 2022 17:25:08 +0200 (CEST) From: Sebastian Huber To: freebsd-hackers@freebsd.org Subject: [PATCH 1/6] pps: Load timecounter once in pps_capture() Date: Thu, 7 Jul 2022 17:25:01 +0200 Message-Id: <20220707152506.55626-2-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220707152506.55626-1-sebastian.huber@embedded-brains.de> References: <20220707152506.55626-1-sebastian.huber@embedded-brains.de> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.6/26596/Thu Jul 7 09:53:54 2022) X-Rspamd-Queue-Id: 4Lf0bK4LMGz3CP1 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of sebastian.huber@embedded-brains.de designates 85.10.215.148 as permitted sender) smtp.mailfrom=sebastian.huber@embedded-brains.de X-Spamd-Result: default: False [0.21 / 15.00]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.987]; R_MISSING_CHARSET(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:85.10.215.148]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-hackers]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:24940, ipnet:85.10.192.0/18, country:DE]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[embedded-brains.de]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_SEVEN(0.00)[8]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; HAS_X_AS(0.00)[] X-ThisMailContainsUnwantedMimeParts: N This ensures that the timecounter and the tc_get_timecount handler belong together. --- sys/kern/kern_tc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 37287df4d1fd..20520adc0aba 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1761,6 +1761,7 @@ void pps_capture(struct pps_state *pps) { struct timehands *th; + struct timecounter *tc; =20 KASSERT(pps !=3D NULL, ("NULL pps pointer in pps_capture")); th =3D timehands; @@ -1769,7 +1770,8 @@ pps_capture(struct pps_state *pps) #ifdef FFCLOCK pps->capffth =3D fftimehands; #endif - pps->capcount =3D th->th_counter->tc_get_timecount(th->th_counter); + tc =3D th->th_counter; + pps->capcount =3D tc->tc_get_timecount(tc); atomic_thread_fence_acq(); if (pps->capgen !=3D th->th_generation) pps->capgen =3D 0; --=20 2.35.3