Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1253467rdb; Wed, 24 Jan 2024 09:12:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFp6em4GzZq2e961Yd0n3i45H6QGmyfW995TpzAC5jK4QnZXqNm5LeNkkC/iaxxQgErGbd5 X-Received: by 2002:a37:e313:0:b0:783:81b4:c156 with SMTP id y19-20020a37e313000000b0078381b4c156mr9283746qki.48.1706116345356; Wed, 24 Jan 2024 09:12:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706116345; cv=pass; d=google.com; s=arc-20160816; b=Ggx+Mx5TEBm90QkwjYI5n1xRVbsn6yJLIxNR2BQLQRTDHBmvf9jyE3EYBFSuxof/nX t+kdS+LtCpaTyEeiPXffuJDIWhGW/06MoVh93DVmCSF771M0FWWPrEXxYpx4RU1fHBXi z7B7xZykASs3AICgDf/72S2SZ8t/DgR92VvqYSnpBYfCRyjHCI0pZuHxH+aD6iL6Eg0j xJsKWhOv65PvBxYrLE2l3a4OFkFPh5QTkYY/lI0kdu+dvTaUptob4LnPO+sSp3YyMI5P dqdWlcs7SJP6KP2nEe2vv8BPPH3d61tRFMUPl3k9tHr+T5KPn8cfXFR5D2TDgoHoZFDB I1jA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=yZkno4JQ8sNmTK6JdUjyHyazBj6Idbytik/XYjIO8RE=; fh=1WE1Oq52udnBHmGnqy7yYt5gCneldgr3XTZCYn9Ft3k=; b=06rT/8sQje4IdRDRO/8rNFauaUIECbXetVtUGu55mBL+Rv+yCEtQL+EYpMMMqfMMrU W1HfLCYqBDufVhxR4Z41YO/JZ8rk5K1H1GJLYgJuFSQ6H29wN6j4sO8XKBVKf4TLY8e1 WgGRGwRtOJtBMnh7FKWvDFPcwdaZnG+y8GupKTgUX9wQBqJ1nB6gZ3CGZUP9lBKKq5FC GbV3q5osozE2+56lFwcd6rbF0BgUFqx4iKz9VvQDFSKVd8FusPBK0nWCCd/jJehIRdJR 086nd2aeTwucGCRLL0h0fSZc21TaL2VC83myuns53M698nEqMCQ2+GZqEDuH5fQtauiU iU8g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TULLLDgB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ee20-20020a05620a801400b00783b3c9be0fsi2004187qkb.481.2024.01.24.09.12.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 09:12:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TULLLDgB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 201411C21687 for ; Wed, 24 Jan 2024 17:12:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 440277F7DD; Wed, 24 Jan 2024 17:12:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TULLLDgB" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F2BD7E795 for ; Wed, 24 Jan 2024 17:12:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706116332; cv=none; b=N34hCPIRFxQlRguxd1Cen5PHc498F2fhcFtoQA25hS3OAsaeh66FnMrbnOPUegTwMUEk4fMJNdOAoIKgEAjAvbFdbT++L2LY2gRiqDdlCRHvf1CdnOLrNMSyKNRSsQm3+LUWh1sAXzIlOlHgKdNfRfcOTDyeUk4Q+sDbayJYZpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706116332; c=relaxed/simple; bh=Oaza5IVgRe39ZJc3EEbe7VFK4k2+2HENytXXpvcr6fM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H87q81dpdgDmbUEw1uCZjCgiQgCF3aDBnQlTOfFKfmIG/2cafZlTviE2wHiD7rVOj4QDiv/kZZwqD1lbdn5PV6pe/RsEoMIkuVAN1Qn1rJG2o11RwYk4DJgmd5wzqDxYiHDEyo//X7EW1sa/Z6sgCwP/lQoHMgIitgBxQi5yZjY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TULLLDgB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA9A4C433F1; Wed, 24 Jan 2024 17:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706116331; bh=Oaza5IVgRe39ZJc3EEbe7VFK4k2+2HENytXXpvcr6fM=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=TULLLDgBs83XXgF7VXjMnixZ/zssNRjrxnns+DXuK9awYVGemG6ku3IoS2YoM8PhD Rc4GkQECuU3XFGv6wmKNEXMlqdpqb5uGrnbdm0EosWsTUZTDyDyDYwh7253hEZTA6A +q/qZ/WN1uSzUYOi0tA/TwYscWfqlnXGgrYDAO6+uQWAoMBxvDCrc07BYuUzyJmzeY jIiRBRjObqwEtD4Y3VPvww62RamIx6jdTaI/PgAY3ooxnXKYoBDIRj+s4CexM9nNpE WCgDK7f/pnmf2J1YRyV2kFcM5PYQVQbjh94sErbMZdEQ+8M+LPIWQG6qI4cIu3AIvt r6PaD79eK7HxQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 664BCCE145A; Wed, 24 Jan 2024 09:12:11 -0800 (PST) Date: Wed, 24 Jan 2024 09:12:11 -0800 From: "Paul E. McKenney" To: Jiri Wiesner Cc: linux-kernel@vger.kernel.org, John Stultz , Thomas Gleixner , Stephen Boyd , Feng Tang Subject: Re: [PATCH v3] clocksource: Skip watchdog check for large watchdog intervals Message-ID: Reply-To: paulmck@kernel.org References: <20240122172350.GA740@incl> <616658ba-0e69-447b-8b52-5051a5aa9bc0@paulmck-laptop> <20240124164803.GN3303@incl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240124164803.GN3303@incl> On Wed, Jan 24, 2024 at 05:48:03PM +0100, Jiri Wiesner wrote: > On Wed, Jan 24, 2024 at 08:03:42AM -0800, Paul E. McKenney wrote: > > On Mon, Jan 22, 2024 at 06:23:50PM +0100, Jiri Wiesner wrote: > > > diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c > > > index c108ed8a9804..3052b1f1168e 100644 > > > --- a/kernel/time/clocksource.c > > > +++ b/kernel/time/clocksource.c > > > @@ -99,6 +99,7 @@ static u64 suspend_start; > > > * Interval: 0.5sec. > > > */ > > > #define WATCHDOG_INTERVAL (HZ >> 1) > > > +#define WATCHDOG_INTERVAL_MAX_NS ((2 * WATCHDOG_INTERVAL) * (NSEC_PER_SEC / HZ)) > > > > We need something here to force 64-bit arithmetic on 32-bit systems > > correct? > > I think it is not strictly necessary because > (2 * HZ / 2) * (NSEC_PER_SEC / HZ) = HZ * (NSEC_PER_SEC / HZ) > so even a 32-bit integer would not overflow when NSEC_PER_SEC / HZ is > bracketed. But I could make a change to: > +#define WATCHDOG_INTERVAL_MAX_NS ((int64_t)(2ULL * WATCHDOG_INTERVAL * NSEC_PER_SEC / HZ)) > to make it explicit and remove the risk of overflow if the constant was > increased (for testing purposes for instance). Good point, and this is just a timeout, so roundoff error from doing the division first is not a problem. This should be good as it is, thank you! I will pull in your v3 for testing and further review, and if it passes testing, send it along to -next. Thanx, Paul