From nobody Mon Oct 11 09:43:57 2021 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 D9BF017FF332 for ; Mon, 11 Oct 2021 09:44:00 +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 4HSYlh0XQjz3m33 for ; Mon, 11 Oct 2021 09:44:00 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from sslproxy02.your-server.de ([78.47.166.47]) by dedi548.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mZrqg-000ErV-F9; Mon, 11 Oct 2021 11:43:58 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mZrqg-000QAe-C6; Mon, 11 Oct 2021 11:43:58 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 10741480084; Mon, 11 Oct 2021 11:43:58 +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 ws7OViLgUSqR; Mon, 11 Oct 2021 11:43:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id A8A3848009D; Mon, 11 Oct 2021 11:43:57 +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 IcXYShIdNXTi; Mon, 11 Oct 2021 11:43:57 +0200 (CEST) Received: from [10.10.171.10] (unknown [10.10.171.10]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 74665480084; Mon, 11 Oct 2021 11:43:57 +0200 (CEST) Subject: Re: Large timecounter delta handling From: Sebastian Huber To: Konstantin Belousov Cc: FreeBSD Hackers References: <5318327d-d247-bb73-81d9-967c4ae18d32@embedded-brains.de> <994a76c2-4ea6-bfdc-bbe5-0795cf8fd4ee@embedded-brains.de> Message-ID: <302debc8-2888-228a-b009-1bade543fb9a@embedded-brains.de> Date: Mon, 11 Oct 2021 11:43:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 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 In-Reply-To: <994a76c2-4ea6-bfdc-bbe5-0795cf8fd4ee@embedded-brains.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.3/26319/Mon Oct 11 10:18:47 2021) X-Rspamd-Queue-Id: 4HSYlh0XQjz3m33 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 [-1.32 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:85.10.215.148:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[embedded-brains.de]; NEURAL_SPAM_SHORT(0.98)[0.979]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:85.10.192.0/18, country:DE]; RCVD_COUNT_SEVEN(0.00)[8]; HAS_X_AS(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 11/10/2021 11:31, Sebastian Huber wrote: >> Your question is more like "under which conditions we switch to use >> tc_large_delta path in bintime_off()?"=C2=A0 Then it is mostly right, = that >> long intervals between tc_windup() calls would trigger it, and it seem= s >> that indeed it is around 0.5 sec. >=20 > Yes, this was the question. >=20 > I think the initialization value should be 50000: >=20 > diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c > index 81d373b3b1d0..a4792e31abd4 100644 > --- a/sys/kern/kern_tc.c > +++ b/sys/kern/kern_tc.c > @@ -87,7 +87,7 @@ static struct timehands ths[16] =3D { > =C2=A0=C2=A0=C2=A0=C2=A0 [0] =3D=C2=A0 { > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .th_counter =3D &dummy_time= counter, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .th_scale =3D (uint64_t)-1 = / 1000000, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .th_large_delta =3D 1000000, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .th_large_delta =3D 500000, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .th_offset =3D { .sec =3D 1= }, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .th_generation =3D 1, > =C2=A0=C2=A0=C2=A0=C2=A0 }, No, sorry. The existing code is correct. I miscalculated the large delta=20 by using th->th_scale for "scale" in th->th_large_delta =3D MIN(((uint64_t)1 << 63) / scale, UINT_MAX); which is th->th_scale =3D scale * 2; --=20 embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.huber@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht M=C3=BCnchen Registernummer: HRB 157899 Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler Unsere Datenschutzerkl=C3=A4rung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/