From owner-freebsd-hackers@freebsd.org Wed Oct 2 06:48:39 2019 Return-Path: Delivered-To: freebsd-hackers@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 6E35F12402F for ; Wed, 2 Oct 2019 06:48:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46jmtt1Wcbz3NMY for ; Wed, 2 Oct 2019 06:48:37 +0000 (UTC) (envelope-from sebastian.huber@embedded-brains.de) Received: from sslproxy01.your-server.de ([88.198.220.130]) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1iFYR8-0005Ol-Hh; Wed, 02 Oct 2019 08:48:34 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1iFYR8-00008V-9F; Wed, 02 Oct 2019 08:48:34 +0200 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 956392A165B; Wed, 2 Oct 2019 08:48:36 +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 8wL4M8fmTZA8; Wed, 2 Oct 2019 08:48:36 +0200 (CEST) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 3C0A02A1681; Wed, 2 Oct 2019 08:48:36 +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 zYEd_ZRbiNY5; Wed, 2 Oct 2019 08:48:36 +0200 (CEST) Received: from huber-nb-linux.suse (unknown [192.168.96.161]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 1E6772A165B; Wed, 2 Oct 2019 08:48:36 +0200 (CEST) Subject: Re: Make timehands count selectable at boottime? To: Konstantin Belousov Cc: FreeBSD References: <0d534569-504f-52c2-f09c-b977fe80843d@embedded-brains.de> <20191001143718.GU44691@kib.kiev.ua> From: Sebastian Huber Message-ID: Date: Wed, 2 Oct 2019 08:48:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191001143718.GU44691@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.101.4/25589/Tue Oct 1 10:30:33 2019) X-Rspamd-Queue-Id: 46jmtt1Wcbz3NMY 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.37 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_SEVEN(0.00)[8]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:85.10.215.148]; IP_SCORE(-0.14)[ipnet: 85.10.192.0/18(1.12), asn: 24940(-1.79), country: DE(-0.01)]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[embedded-brains.de]; NEURAL_HAM_LONG(-1.00)[-0.995,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[148.215.10.85.list.dnswl.org : 127.0.10.0]; NEURAL_HAM_MEDIUM(-0.94)[-0.938,0]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:24940, ipnet:85.10.192.0/18, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; HAS_X_AS(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 06:48:39 -0000 On 01/10/2019 16:37, Konstantin Belousov wrote: > On Tue, Oct 01, 2019 at 12:48:46PM +0200, Sebastian Huber wrote: >> Hello, >> >> a recent commit made the timehands count selectable at boottime: >> >> https://reviews.freebsd.org/D21563 >> >> What was the reason for this change? >=20 > See the followup thread on the svn-src@ list for this revision. Thanks for the hint. So, this change is related to the PPS handling and=20 the things which happen between a pps_capture() and pps_event(). What I don't understand is why more timehands are a problem for the=20 consumer side. For example: void binuptime(struct bintime *bt) { struct timehands *th; u_int gen; do { th =3D timehands; gen =3D atomic_load_acq_int(&th->th_generation); *bt =3D th->th_offset; bintime_addx(bt, th->th_scale * tc_delta(th)); atomic_thread_fence_acq(); } while (gen =3D=3D 0 || gen !=3D th->th_generation); } With more timehands the time frame in which th->th_generation remains=20 constant is longer the more timehands you have. So, it is less likely=20 that you have to execute the loop body twice. The count of timehands is=20 limited by the timecounter frequency and mask, and the hz configuration. --=20 Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG= .