From nobody Sun Jan 12 15:27:37 2025 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 4YWK5V1Jb4z5kqmh for ; Sun, 12 Jan 2025 15:27:42 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWK5T4gS5z4npc for ; Sun, 12 Jan 2025 15:27:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6d8f916b40bso48692666d6.3 for ; Sun, 12 Jan 2025 07:27:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736695660; x=1737300460; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=lZ6o+i9dZkmBSN4nYzakLpJJG9+X2ztJFduu2OI91Ng=; b=M4BHt2OeS1P0HCihNCmyZhdrXYDErYfC/C7NohhjeZKjWHs3UsV4St6fvDoGxb45nr 5O7gDnaTiWk4/upRjjcG1PclAnp5yzKynZ0Omx0wQbImA2S3gQjdQPs6B6Mif8vDw7jk 8vXYBT1x5w0/Qwp2k4fGEi/VsJnD3zt7oY5mkO2j20P+kZu4d+TfX+5bComUJrTiOmVc ptlr8Q5ntvdCJ9DDpCx/yvQmjOfyw64rzERN3Si2Gt5jeF4OpjkRjqWBh0QwAN09cw/e NuHVDpKOBFfvrgeXfSrZ2VPdCbf8MiStt4+HbOfAg4b2DH/b2KhDYPLeEqcHfAI3QM+v dp4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736695660; x=1737300460; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lZ6o+i9dZkmBSN4nYzakLpJJG9+X2ztJFduu2OI91Ng=; b=Lg0GOeKWIdduPuoB2wPzr942ziQ6yNoWNuOyxXX3qrZEH/7AWeo6RmdQYfGwVZz98x AI6u6rk3bmqS/4/wKepggsEBgISWUMjQBcJfNPFQbkdhitEqGdZfw46Rx2ZNMTPYh0R7 S0Ek5gaQcwZ4+OjWsFtE9yL1aBrpwZgUZumFrJQRHFYVlWLFv7sDcpIjZS/3ss5nco3x 97B/DCSoC0T0xFbgvLGHK0LRfVfYSPdAOKqSZ5m3H1iRrYBvIKhG0oqQjWWXQEB8Jb5F U7UeXD8+GfhAKR5eGHYMs4q+sJtvBhIjXRK1UazBQOq4c5fBpNQESMtHNW4j/5N7ZZVI 2nKg== X-Gm-Message-State: AOJu0YwQdTPFc6j2jCSSSRGjaNXyga2g0Gk7VWIDrMNKtaVcuReZH6Ix 33ufw18KGwyupPqiKzDnnZhBt3IMisgo+pMRaZDw/GdBX5B16Es2fChR5g== X-Gm-Gg: ASbGncunLqeZia2d7YBUJ3r3/HPywJ/TRw3dGLkjT9kuwc7GJeZeLQmRVSfOYRrjcxM lfGpbFQLCxTc9x1dZno9XhBSTo4DPM4RDqQWLvGTBsJn213Bn+1vCfMGARVVA6cXaxwxDAFNMNh NWAxJLlij38hUryrCofU+g0jB2M18jyzjKV/JU05/JXCSYbu0sHD42lEyIKCHgX/fv3i91Ge+Kc Hrb6htKyHESunIOMyquTRIJz4inH/7jcaELHmyS7m8H/eSibQXnD1PUVNEG97OX/ZuzlNE= X-Google-Smtp-Source: AGHT+IFK/Va1EPyDX4J2SbGKkPv9AqTx5zKzYb+0cQYOmf/O0Y9qpgawpjtU7H4Q0RNL9uMrG7JACg== X-Received: by 2002:a05:6214:1d24:b0:6d8:821d:736e with SMTP id 6a1803df08f44-6df9b28d3camr330262576d6.36.1736695660261; Sun, 12 Jan 2025 07:27:40 -0800 (PST) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6dfadeb40d4sm30890306d6.119.2025.01.12.07.27.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 07:27:39 -0800 (PST) Date: Sun, 12 Jan 2025 10:27:37 -0500 From: Mark Johnston To: Tomoaki AOKI Cc: freebsd-hackers@freebsd.org Subject: Re: widening ticks Message-ID: References: <20250111131106.4d2657de20eeed7eef5c0b15@dec.sakura.ne.jp> <20250112043543.86b303419f954b2b287d39d1@dec.sakura.ne.jp> <20250112075038.4cd7fc680400e07a32a13f1a@dec.sakura.ne.jp> <20250112111651.e76aea0843ac8f85043c7f10@dec.sakura.ne.jp> 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250112111651.e76aea0843ac8f85043c7f10@dec.sakura.ne.jp> X-Rspamd-Queue-Id: 4YWK5T4gS5z4npc X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sun, Jan 12, 2025 at 11:16:51AM +0900, Tomoaki AOKI wrote: > Replying to ML only, as Mark's gmail address seems to block previous > one. > > On Sat, 11 Jan 2025 18:00:12 -0500 > Mark Johnston wrote: > > > On Sun, Jan 12, 2025 at 07:50:38AM +0900, Tomoaki AOKI wrote: > > > On Sat, 11 Jan 2025 17:35:36 -0500 > > > Mark Johnston wrote: > > > > > > > On Sun, Jan 12, 2025 at 04:35:43AM +0900, Tomoaki AOKI wrote: > > > > > Not an example of code, but for example, when ticksl is at > > > > > 0x7fffffffffffffff (positive value), ticks shoule be 0xffffffff > > > > > (negative value), if I read the diff correctly. > > > > > The same thing starts happening ticksl is at 0x0000000080000000 throug > > > > > 0x00000000ffffffff and values alike. So signs (carry bits, usually the > > > > > leftmost bit of each) should be checked separately for ticksl and ticks. > > > > > > > > That's true, but I can't see why any code would care about this? > > > > > > While ticks is defined as (signed) int, it shoule be turnaround when it > > > reaches at 0x7fffffff (as incrementing it causes overflow). > > > Is ticks allowed to be minus value? My guess is that it is monotonic > > > counter. > > > > Yes, INT_MAX ticks elapse in approximately 25 days at 1000Hz. In fact, > > ticks is initialized to INT_MAX - in subr_param.c so that > > it wraps around shortly after boot, after which it is negative. > > > > Kernel code should not care about the sign of ticks. > > Thanks! I've overlooked it. > > BTW, does tickl restricted with INT_MAX, too? (In detail, although tickl > has the type long, but actually the range of the values used are > restricted with INT_MAX?) No, that's the point of the change: the kernel now increments a counter of type long, so it will eventually reach LONG_MAX. Existing code which references ticks will still get a 32-bit value that behaves the same as before.