lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 20 Feb 2024 09:09:52 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Feng Tang <feng.tang@...el.com>
Cc: Waiman Long <longman@...hat.com>, Thomas Gleixner <tglx@...utronix.de>,
	John Stultz <jstultz@...gle.com>, Stephen Boyd <sboyd@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>, linux-kernel@...r.kernel.org,
	Jin Wang <jin1.wang@...el.com>
Subject: Re: [PATCH v3] clocksource: Scale the max retry number of watchdog
 read according to CPU numbers

On Tue, Feb 20, 2024 at 11:27:21PM +0800, Feng Tang wrote:
> 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.

I am also not averse to starting with the above, either.  ;-)

							Thanx, Paul

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ