The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Waiman Long <longman@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	John Stultz <jstultz@google.com>, Stephen Boyd <sboyd@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	<linux-kernel@vger.kernel.org>, Jin Wang <jin1.wang@intel.com>
Subject: Re: [PATCH v3] clocksource: Scale the max retry number of watchdog read according to CPU numbers
Date: Tue, 20 Feb 2024 23:27:21 +0800	[thread overview]
Message-ID: <ZdTE2SzO1pZ0QjUn@feng-clx.sh.intel.com> (raw)
In-Reply-To: <0b7833a4-75f3-43ba-9d87-6f83cf4faa5a@paulmck-laptop>

On Tue, Feb 20, 2024 at 07:24:27AM -0800, Paul E. McKenney wrote:
> 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;

Good point! Initially when writing the patch, I did try to search if
there is a 'ilog4' api :) as the ilog2 of that 8-socket machine is
about 10, which is more than enough.

Thanks,
Feng

> 
> but I am not at all opposed to starting without the division by 2.
> 
> 							Thanx, Paul

  reply	other threads:[~2024-02-20 15:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 13:45 [PATCH v3] clocksource: Scale the max retry number of watchdog read according to CPU numbers Feng Tang
2024-01-30 13:55 ` Paul E. McKenney
2024-01-31  0:53 ` Waiman Long
2024-02-19 11:32 ` Thomas Gleixner
2024-02-19 14:37   ` Feng Tang
2024-02-20  2:20     ` Waiman Long
2024-02-20 15:24       ` Paul E. McKenney
2024-02-20 15:27         ` Feng Tang [this message]
2024-02-20 17:09           ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZdTE2SzO1pZ0QjUn@feng-clx.sh.intel.com \
    --to=feng.tang@intel.com \
    --cc=jin1.wang@intel.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox