Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1800090rdb; Tue, 20 Feb 2024 07:24:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVHdlMssM1GP0ZJkN5epNB8Q+q8Utfx9N0C2I38KZUaKKBgBFBxEf/kS+czFqhsMIEtf/tvTZXfaEAlezl27gdW5jhWCaRrZ+XOJZUP3g== X-Google-Smtp-Source: AGHT+IEQO0j9dCKnBqJXBkinATi3F0u/JieMFInYDMtdeZAK+1OnyFw4p8fAN0UKCdeYmmm2FKke X-Received: by 2002:a05:6a21:9216:b0:19e:a3d4:24be with SMTP id tl22-20020a056a21921600b0019ea3d424bemr17113997pzb.49.1708442673156; Tue, 20 Feb 2024 07:24:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708442673; cv=pass; d=google.com; s=arc-20160816; b=d8XHTewlA5xkGRc2JNFSCwq5zJppnIEpS66rDMUCW1DfGVCiH9LMPT6IICy3w34SI2 /6YNY1oowxcJXxjqRvL6JOBrWhxgr+erG7zOLGOTIzcJudZJVZDTiJ/Dh5ZjD7+WU5u0 l/UorZtmt1O4SKtGbo6Ehl1OkgNRu5uCKYeRD63E/9k/TSQ3A6YPezrAa+UnDss05Wnk UggNQWP44I321TDPI4hzsDAMvhHgAwUM08yqrYGjqYCGIw4GKRmW/DMCerLi/NCMYoyc iai9S68odEfx8Pe9iegNmF4rA553/gi2vkI4OffBsnaJal4Qpl8BX21oYCmTmXspNpsV vy5w== 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=u+5O2bRw1fXZW+LszJOxhteSeFM2ek2wT8guI9fHV8c=; fh=UF/a3wc7zi0XffJGSRk3ZZzTMougS0ankHFLZkPhuBs=; b=S/RDWDy2IYTdTrdmzgh2cubJpKs8+JAcyOIzmFTgfzOu6gmKfaK0FPPncQerEZQbiH 9gfsShCNNoqz+qOW7uLoMCtZqcsRmm754BlSaN75K6ZBsWGks0mo35JMDaPP4AZXA/UY a9vOhD71PAjX5AaXR8JQZs6dcmdLwTOJWbL+OBmah5uXoN/x21hJXHGGouW81BACcjE+ 40kGWMsyfo9+cIPrDQFUauWnZh1Q0I/SG7iREAhSASWJtrFdFqnLHNX9xTDyncaxKAQR rj1uqFZ5WAo3Ek+H1P8fc+JnfFyoCMML7kSfPPb293Z9HIJcJ6tKdfrsLXVMV9H9LhbB 8/mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WVOSjA5T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-73235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73235-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g69-20020a636b48000000b005cd6507bb84si6233542pgc.183.2024.02.20.07.24.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:24:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WVOSjA5T; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-73235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73235-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D6E85281966 for ; Tue, 20 Feb 2024 15:24:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33C67762C1; Tue, 20 Feb 2024 15:24:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WVOSjA5T" 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 282CB762C0 for ; Tue, 20 Feb 2024 15:24:27 +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=1708442668; cv=none; b=Rqvk/2qlKOJFv1mG4Iqk8EA+kwCljfYQ4qLQi7Sx1vJq0u5R+C+N2Q4ZGM4Z3p77wmUm4BF/XPSi9j0h5lOzPix9Kz6QT4jRgQWaxivR+GSb0KhsfU4yaNrLIE6PPkW6l96nGxMVJ9PTc+12JfFMpodIi8dF0IUfxTtg3OlbHaQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708442668; c=relaxed/simple; bh=I39SMvyeoy5GuZYooWccYn7jsz0Je7bnyUlzPSNDv9s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RT7f5CB1cvsdPM9XjpWJWHarF18u/H+xoxgaAtAk4/v5JE/rm1MAqDY0zOSxD/qtMN32m1RbVc/Bg1PzHMsHotKAFI5GqDkqqhj+FuESrecJedYSMHyGB1oG8dWcfuccSOyQwPC0VlxfxABRRphGRnHO5M2Sp0SulBahDrdJRXo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WVOSjA5T; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7230BC433F1; Tue, 20 Feb 2024 15:24:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708442667; bh=I39SMvyeoy5GuZYooWccYn7jsz0Je7bnyUlzPSNDv9s=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=WVOSjA5TaQlyoXDrybiLMrdo/Zi6dJ4asvUVFKQutpuJqICOLFstsc4lh/bxXrxZu Mq1TBm8hPMTu2Lg2tv0ndWyBdkCi3n7Dw/5W6c1brEJr67GOaFJe71u1duVnUdxn2e 3HQjzbIMMevewJjPoQBqqG5pCYda5fg0lF3r+ouocihRuG+7M+f4L/k79hf25m56oo BN2kSjsMwsJKrmxIH7BAuNK0Et9Q3K0q+m8RxtzeC4DM7rPCAeGNN5nuBTZ3RjNWuq shdgQnzLa6wO0dTU+tePCNokj+4lPSn6If6GmsK0DfK4Vd8WoMUQquMDDF7SMEEW8S 9/bJ++fe+LJxQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 2244BCE109C; Tue, 20 Feb 2024 07:24:27 -0800 (PST) Date: Tue, 20 Feb 2024 07:24:27 -0800 From: "Paul E. McKenney" To: Waiman Long Cc: Feng Tang , Thomas Gleixner , John Stultz , Stephen Boyd , Peter Zijlstra , linux-kernel@vger.kernel.org, Jin Wang Subject: Re: [PATCH v3] clocksource: Scale the max retry number of watchdog read according to CPU numbers Message-ID: <0b7833a4-75f3-43ba-9d87-6f83cf4faa5a@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20240129134505.961208-1-feng.tang@intel.com> <87msrwadvu.ffs@tglx> <388686b2-5305-43d1-8edf-19ba66d52727@redhat.com> 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: <388686b2-5305-43d1-8edf-19ba66d52727@redhat.com> On Mon, Feb 19, 2024 at 09:20:31PM -0500, Waiman Long wrote: > > On 2/19/24 09:37, Feng Tang wrote: > > Hi Thomas, > > > > On Mon, Feb 19, 2024 at 12:32:05PM +0100, Thomas Gleixner wrote: > > > On Mon, Jan 29 2024 at 21:45, Feng Tang wrote: > > > > +static inline long clocksource_max_watchdog_read_retries(void) > > > > +{ > > > > + long max_retries = max_cswd_read_retries; > > > > + > > > > + if (max_cswd_read_retries <= 0) { > > > > + /* santity check for user input value */ > > > > + if (max_cswd_read_retries != -1) > > > > + pr_warn_once("max_cswd_read_retries was set with an invalid number: %ld\n", > > > > + max_cswd_read_retries); > > > > + > > > > + max_retries = ilog2(num_online_cpus()) + 1; > > > I'm getting tired of these knobs and the horrors behind them. Why not > > > simply doing the obvious: > > > > > > retries = ilog2(num_online_cpus()) + 1; > > > > > > and remove the knob alltogether? > > Thanks for the suggestion! Yes, this makes sense to me. IIUC, the > > 'max_cswd_read_retries' was introduced mainly to cover different > > platforms' requirement, which could now be covered by the new > > self-adaptive number. > > > > If there is no concern from other developers, I will send a new > > version in this direction. > > I see no problem simplifying it. My guess is that we will eventually end up with something like this: retries = ilog2(num_online_cpus()) / 2 + 1; but I am not at all opposed to starting without the division by 2. Thanx, Paul