Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1256153rdb; Wed, 24 Jan 2024 09:16:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+UAyPVtUtgWnQvCEVAwpRu0HcYqzKED0yk8QMD6MS0O3bUk399G9UwzTMEX7msuE6A33h X-Received: by 2002:a17:90b:710:b0:290:eee4:14de with SMTP id s16-20020a17090b071000b00290eee414demr1076376pjz.41.1706116596174; Wed, 24 Jan 2024 09:16:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706116596; cv=pass; d=google.com; s=arc-20160816; b=y8tq3ZAZ6OUEn5TJSh7Vmhp5ASVFVlQG8g0atISZbU55RftK0yy+yCZtjlhYrwFdO2 JgL1WSFUyalGY4h3saJE8Zia1Qa/VSJLw6t/AlAkanUorEQy2uWK5/YS2e/d4DuRRLHq /tiYt9ZuDkaWYaHeh49mOvXlZzSBBFfth5Fc8CQZPsaCSRUJa98UgA+4MOF284c2TJcj Y7VEmRCzeM2dAUP8oyiYOmEH9+5/qw8RXpSiBTge6Y1O9980W4VHuXXsH5YcnseKRREq dMi2tkLfxVmjCZ/lOkSPECbbvcIgB4dksre3JwiYV3kqF2D2jNjVe0F+SAmdLdbYmOjV EJHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=deYdVLn3EVvqbbVHh0i0wtu2QgPNSehyZazTApJhKrg=; fh=etSatNF1h57OmjGKlDFFFMyaejnIoSGGB+eUjz0GHT8=; b=TJlJSGRuwvbYcvOEW0kXM5u3OFMxlMP3KqrI8IhqLwA3S8U76GfpVAO6DcPFew5quU p/5zuacR2HNcd0lWc/e+yYJPOaGA8UuVDzAjtqwUE7uEPPCtIXwquCs2nAyFI+6xC6s4 kw8mYYxKZuOnXHQOm+x2qAJuwyeEARd6+piXyl3RaJlae/Wlm9XuqW2KISniRwf1kU5+ /JDH4iZzi5Y+WUPJS5K9gXCOUFT9Aqmac/AsAr1ypvl6Iexs8kxd/Fe2QREC7keBChXp 5gJjfxUReEsL27J3vK8sX2wjOaFz8IcN47nzklIMamePZg95b65qbwMJnkdMMyOCVsq+ T+Lw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=VjLsKW8e; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=n3rHKEOI; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-37354-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bv13-20020a17090af18d00b0028e7b59d66dsi12064161pjb.3.2024.01.24.09.16.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 09:16:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37354-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=VjLsKW8e; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=n3rHKEOI; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-37354-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5C136B2377D for ; Wed, 24 Jan 2024 16:48:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93E867E573; Wed, 24 Jan 2024 16:48:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="VjLsKW8e"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="y5akeZec"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="n3rHKEOI"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="VUm2Bo5F" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C10D47CF1C for ; Wed, 24 Jan 2024 16:48:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706114888; cv=none; b=dMJ08FUij8UjIel+CVX71fhveagaJcACia6lR/GUl9E+1khk8D6h0BIkdDFTgv6yVxKrnw4pGhkb0K3LIopvlvNJ1b+UCGuLrZXm26yBT1yeC8/Mfy5/HVSPg4wOm/h9OJO2TEFtGmmrub+cU1rzWac1kHMQiV8tRIdqTTRhiLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706114888; c=relaxed/simple; bh=hWmCZIpPN2us1XGyAgS1SXD2VMgRqqSnFVFB7++XIsQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YItIn469hXgift5zJlbsIwwxZ6froBH3y8fXvKFavjoDeodzqCiF04cwMjsbx0Tr1vDgFPcPVYceyXivMKNWfzugjbnLWHD4dJ9RdB+24YyMzzMmu2kDCuXpvQEx95DRgUTCLJEJ00o/ir37/Ln+CrIVP170ZlVxSSEyUnNcVbM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=VjLsKW8e; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=y5akeZec; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=n3rHKEOI; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=VUm2Bo5F; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (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) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E9CDE1FD7F; Wed, 24 Jan 2024 16:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706114885; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=deYdVLn3EVvqbbVHh0i0wtu2QgPNSehyZazTApJhKrg=; b=VjLsKW8e5EPEbuhjj8KaEYARrveb7pltz8WOa/t50vMZq0RC50cmcwJhFJahvCYz0zKb0R EMqeWCabn4qhXZbfceA61xMmUUZb7JUpuNp99kbSNeRPd61Xz3V8YNpsf3qzURRvbkZsEa 2ozLYC7KmNNaIoc7GA/1yj9gNpPmjxs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706114885; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=deYdVLn3EVvqbbVHh0i0wtu2QgPNSehyZazTApJhKrg=; b=y5akeZecYCJTgBXh0WymglY9yUNbxf/kWMvPN2wHN4crsyCwChg/UeXRBeztZ2UyLT1MNP KAiLuzRI83gWzxBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706114884; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=deYdVLn3EVvqbbVHh0i0wtu2QgPNSehyZazTApJhKrg=; b=n3rHKEOIwjFMCKSJOmcR+ynCMfv9lIRBpxe0dwFy0F0d1P3Y1tQAue4Et42BHkiLIQH+Sa S1Eg9pbGwOwf2hqhIJZ6wJBQro4MlGyffrOi1meEuwcE8cd+Zd7NJY1aH3X5680z3g+4cA swhK1QpQzMZjqtw4vlPz2Dikk0DjdlU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706114884; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=deYdVLn3EVvqbbVHh0i0wtu2QgPNSehyZazTApJhKrg=; b=VUm2Bo5FCbkFkainJTn81ZmquvCQ7FT+Vhm7FLkFYHAJtr4iczVYJrDIJ3KcB2FUijIxyH XxWAvN5hU6mKIcCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D60081333E; Wed, 24 Jan 2024 16:48:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id qlg7NEQ/sWUqKgAAD6G6ig (envelope-from ); Wed, 24 Jan 2024 16:48:04 +0000 Received: by incl.suse.cz (Postfix, from userid 1000) id E34359C97B; Wed, 24 Jan 2024 17:48:03 +0100 (CET) Date: Wed, 24 Jan 2024 17:48:03 +0100 From: Jiri Wiesner To: "Paul E. McKenney" 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: <20240124164803.GN3303@incl> References: <20240122172350.GA740@incl> <616658ba-0e69-447b-8b52-5051a5aa9bc0@paulmck-laptop> 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: <616658ba-0e69-447b-8b52-5051a5aa9bc0@paulmck-laptop> User-Agent: Mutt/1.10.1 (2018-07-13) Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: ** X-Spam-Score: 2.15 X-Spamd-Result: default: False [2.15 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(2.75)[0.918]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[24.19%] X-Spam-Flag: NO 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). -- Jiri Wiesner SUSE Labs