From nobody Sat Jan 11 15:59:08 2025 X-Original-To: dev-commits-src-all@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 4YVjrF4h6Hz5kW15; Sat, 11 Jan 2025 15:59:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVjrF49p8z4j7D; Sat, 11 Jan 2025 15:59:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736611149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OkZMwRPHiiuAzjFfeoHAqRRc9d2wZRSu5JMjDvmqLOs=; b=iW3bWPZ6kPMZo581IUHw78Wp4wuMyqRO9CQGkbp33Ye9jGMtAqgYCUTdE91XrKN208GxYn 9376udmKpT6qN2PIUsNE8+8Awtx9Jj/vxrMkr2t6J1aNtWEksYddX+FXfzQUO9rBtWl9x/ yeGC3Mx9x5l548+J+jZT9/TEQQC0POqLg2yDQIWStEC6i4pUN8ElyGv4qZBkLPYpth2HHy FhffbPAhRti8ZcV78lGZrsBaubSClkpmYtf40qz/P91ZwMPiZ6blodoClNyAibxGIw86K7 tAYFboYkcsOFFXmXjXw4l2xldjOk8+EYgW9I04N6jrcbbKCzg14htxxWUf6QrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736611149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OkZMwRPHiiuAzjFfeoHAqRRc9d2wZRSu5JMjDvmqLOs=; b=tNhPMjEewbvoRnB+bID02XJi+z96VFCYhn/2jZQvELF3RMPGvMrPZL9KHFSsNB2ts1WpwW jZb+koG5GODhl/EDVDZIFn1VO+0498J2DxPgS293mDn50uBB/2AuHQbiDReF7qEBjKzBgB vrTo8Wr0bSKwMNx8FA+7+WVahPUSDtQq5OZL4cLFXni+D7AqYRavdwPVTGHdvgGrCati/K ZxAptVOGyNg7IVygKFypO2UHGBL34UBpwDIxlflNCmjde5LMoys1AabREaJtgqOdhZihKi WxqZzD5NdH0cD/GquKijtiDCI6ecEdLowtKMnFaCuWFJ6qv/+4NbwxtCZ8k+QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736611149; a=rsa-sha256; cv=none; b=dP5pTn/RUfU7UfZDO4X5Zu3puC7twilK3ivLSKQSECTZnx25QYDSWgZfhXjxz8trv8gL0t x5FjFfF6EUvwWGQFYiMc8hZxO8qkQLlPLOX9ki6mKIDQK0D2JTH81SAfD4snANxOKgXx8z yJXKnXF3HA1D0C7A1LqPSd6GcDmt9RX/olvCjzsACKf9DDBzSeDqgt4Xoj2jpK6o8lsRSZ +dHWdeemJRkrM2Jcy+4ScjpPLuUWvzqpyKkeBnFd8LFdk9Zeuy+qeceDsBtVVDOI7qEC/g n57b9Cb83xrY0nSSisafm0pGMe9MRf0RKcIbfKJbY1u/J5lQuLASDO1k3eqCLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:5c0:4200:b830:1cab:36b6:e060:c22d] (unknown [IPv6:2601:5c0:4200:b830:1cab:36b6:e060:c22d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YVjrF2S5yz9Tt; Sat, 11 Jan 2025 15:59:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Sat, 11 Jan 2025 10:59:08 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 6b82130e6c9a - main - clock: Add a long ticks variable, ticksl Content-Language: en-US To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202501101600.50AG0jk6062308@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/10/25 11:00, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6b82130e6c9add4a8892ca897df5a0ec04663ea2 > > commit 6b82130e6c9add4a8892ca897df5a0ec04663ea2 > Author: Mark Johnston > AuthorDate: 2025-01-10 15:37:07 +0000 > Commit: Mark Johnston > CommitDate: 2025-01-10 15:42:59 +0000 > > clock: Add a long ticks variable, ticksl > > For compatibility with Linux, it's useful to have a tick counter of > width sizeof(long), but our tick counter is an int. Currently the > linuxkpi tries paper over this difference, but this cannot really be > done reliably, so it's desirable to have a wider tick counter. This > change introduces ticksl, keeping the existing ticks variable. > > Follow a suggestion from kib to avoid having to maintain two separate > counters and to avoid converting existing code to use ticksl: change > hardclock() to update ticksl instead of ticks, and then use assembler > directives to make ticks and ticksl overlap such that loading ticks > gives the bottom 32 bits. This makes it possible to use ticksl in the > linuxkpi without having to convert any native code, and without making > hardclock() more complicated or expensive. Then, the linuxkpi can be > modified to use ticksl instead of ticks. > > Reviewed by: olce, kib, emaste > MFC after: 1 month > Differential Revision: https://reviews.freebsd.org/D48383 > --- > sys/conf/files | 1 + > sys/kern/kern_clock.c | 26 ++++++++++++++------------ > sys/kern/kern_tc.c | 4 ++-- > sys/kern/subr_param.c | 2 +- > sys/kern/subr_ticks.s | 44 ++++++++++++++++++++++++++++++++++++++++++++ > sys/sys/kernel.h | 9 +++++++++ > sys/sys/timetc.h | 2 +- > 7 files changed, 72 insertions(+), 16 deletions(-) > > diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c > index 19169ba63061..f4359efec466 100644 > --- a/sys/kern/subr_param.c > +++ b/sys/kern/subr_param.c > @@ -197,7 +197,7 @@ init_param1(void) > * Arrange for ticks to wrap 10 minutes after boot to help catch > * sign problems sooner. > */ > - ticks = INT_MAX - (hz * 10 * 60); > + ticksl = INT_MAX - (hz * 10 * 60); > > vn_lock_pair_pause_max = hz / 100; > if (vn_lock_pair_pause_max == 0) Did you consider using LONG_MAX here instead of INT_MAX? That would make both values roll over 10 minutes after boot so that sign problems can be tested for both counters. -- John Baldwin