From nobody Sun Oct 10 17:15:39 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 B600617DE9A3 for ; Sun, 10 Oct 2021 17:15:50 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2o.ore.mailhop.org (outbound2o.ore.mailhop.org [54.187.213.119]) (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 4HS7qV2q4Dz3LN8 for ; Sun, 10 Oct 2021 17:15:50 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1633886144; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=qHa1xW+LcYWXM0Vp5qAHBs8VpGNLDfe6ZCftC8QSf+OG/DHOYHolqZEL0qOoby+pdW+TpZr2SWipe nVihH/LqQjZDYWT62LzoNeWDEqA4ek0mIq5GJIEkrNm+y6hwYypRHmZpBVmd6mRKKlUgcfeufjjdwd vC1IPfmjevR6rl66YcpGDbonqn1Y7LLEitSrng/by23xH4y1FuJAiHc+Nz1StkCwNtq/hkNBf0iQ8W fMD3p2c8l9PhPAvMVK4m5sQcxkH0VUMpOcCgc/vHJyx3GazBs/TNVdei8ojQ/HCD3YfMMyAkRWRj6a noop+/z98z/PIZAs3u649ymoBrOe1SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=ZEuP4/08p10U6C+sSA/dMLWi+kbZSn0+mC6CaIdk85o=; b=UuZYpxezymK89EHDGyvAXG8O92IsKBqsblbSR7BSwonlcAoaixMaC3HxJIm+C9GOmA8RwCtlTpXWl HpopB+WpfVaMjKzrs1S1hQOiIZzACPaImJDjOVPLMhmRC5oRQD4zSDvy5+M2OKGOmP99PPwkGsP2iD BDYaFr0dPxj/C73LSdXtwbNpRWlS/c0EeAe8vuw/rBlcrgIwvbrpz2aGKPDgkz8lY0hiWyVEE4kqfH ud29ghxd5MvCif6wnZERRj38omRCpg+eRHUfY/iFEkcg/V6fR4UZ+ikPkz/Fhz0wZDErH7J5+/oYUh rydBpl+CKEr0IK9mhojvU8USjtQegbA== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=24.8.225.114; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=ZEuP4/08p10U6C+sSA/dMLWi+kbZSn0+mC6CaIdk85o=; b=bLTyohy23tskohcZ11AFCr8fd/XiIFz+H11M4txBGcpucsPm54fbO+zJdR3sA+PkTgrdmTD2eHpmw PXr0kT1F2ILluwQRIbfKpXS7q9LoiLNOgRJl8aaOFwTemVxnv9j2VJKlOgLIjPI34fYARNPA+hdCB5 DPySQx1WG3MbG2Bqzqj3x6zlDgShx3ckEBrR+1ZKVIyQjT9yVNUI+2AY8SmOwsEtkxF4U8mlgaRl// 8cs1rmClOwz78HPoNnL923rU4oKqaj1w0h/XeGXBNsz/npZlO8rOM21dqyyztOP1Ja0mQ+sncxZHMv BOWT+msvJOrhqCfRgoG7SClPf+dSRVA== X-Originating-IP: 24.8.225.114 X-MHO-RoutePath: aGlwcGll X-MHO-User: b19c790b-29ed-11ec-a67c-89389772cfc7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-24-8-225-114.hsd1.co.comcast.net [24.8.225.114]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id b19c790b-29ed-11ec-a67c-89389772cfc7; Sun, 10 Oct 2021 17:15:42 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 19AHFdPC034355; Sun, 10 Oct 2021 11:15:39 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: Subject: Re: Why was the timehands_count sysctl added? From: Ian Lepore To: Warner Losh , Konstantin Belousov Cc: Sebastian Huber , FreeBSD Hackers Date: Sun, 10 Oct 2021 11:15:39 -0600 In-Reply-To: References: <2d1d2a6d-ec6b-7f52-8af3-09a833c52820@embedded-brains.de> Content-Type: text/plain; charset="ASCII" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team 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: 7bit X-Rspamd-Queue-Id: 4HS7qV2q4Dz3LN8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, 2021-10-09 at 14:54 -0600, Warner Losh wrote: > On Sat, Oct 9, 2021, 1:56 PM Konstantin Belousov > > wrote: > > > On Sat, Oct 09, 2021 at 09:41:28PM +0200, Sebastian Huber wrote: > > > Hello, > > > > > > I synchronize currently the port of the FreeBSD timecounters to > > > RTEMS and > > > came across a change in 2019 which I do not understand. Some time > > > ago the > > > timehands were reduced from 10 to two: > > > > > > https://reviews.freebsd.org/D7302 > > > > > > In 2019 this changed again to be up to 16: > > > > > > https://reviews.freebsd.org/D21563 > > This review did not changed it back to 16, the default value is > > still 2. > > It allows to bump the number of used timehands, but normally > > systems run > > with only 2. > > > > > > > > The corresponding sysctl is not documented: > > > > > > https://www.freebsd.org/cgi/man.cgi?query=timecounters&sektion=4 > > > > > > Does someone know why this sysctl to select the count of > > > timehands was > > > added? Is this a performance optimization for some systems? > > > > To allow for experimentation, and to satisfy some requests where > > people > > wanted to have more that 2 timehands. > > > > When would someone want that? What's the use case? > > Warner > > > One known usecase is a single-cpu (non-SMP) system that uses a PPS signal. With only two timehands, a pps pulse that arrives while the system is in an idle-sleep (wait-for-interrupt) state will switch timehands too many times between the wakeup and the capture and trying to use the capture data, so that the th generation count never matches, and in effect you never capture a PPS pulse. I found that on a BeagleBone system. It takes a minimum of 3 timehands for it to work right. -- Ian