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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Znm8PhfeK7nSQuuo@slm.duckdns.org>
Date: Mon, 24 Jun 2024 08:34:38 -1000
From: Tejun Heo <tj@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: torvalds@...ux-foundation.org, mingo@...hat.com, juri.lelli@...hat.com,
	vincent.guittot@...aro.org, dietmar.eggemann@....com,
	rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
	bristot@...hat.com, vschneid@...hat.com, ast@...nel.org,
	daniel@...earbox.net, andrii@...nel.org, martin.lau@...nel.org,
	joshdon@...gle.com, brho@...gle.com, pjt@...gle.com,
	derkling@...gle.com, haoluo@...gle.com, dvernet@...a.com,
	dschatzberg@...a.com, dskarlat@...cmu.edu, riel@...riel.com,
	changwoo@...lia.com, himadrics@...ia.fr, memxor@...il.com,
	andrea.righi@...onical.com, joel@...lfernandes.org,
	linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
	kernel-team@...a.com, David Vernet <void@...ifault.com>
Subject: Re: [PATCH 19/39] sched_ext: Print sched_ext info when dumping stack

Hello, Peter.

On Mon, Jun 24, 2024 at 02:46:18PM +0200, Peter Zijlstra wrote:
> On Wed, May 01, 2024 at 05:09:54AM -1000, Tejun Heo wrote:
> 
> > +static long jiffies_delta_msecs(unsigned long at, unsigned long now)
> > +{
> > +	if (time_after(at, now))
> > +		return jiffies_to_msecs(at - now);
> > +	else
> > +		return -(long)jiffies_to_msecs(now - at);
> > +}
> 
> You have this weird superfluous else:
> 
> 	if ()
> 		return foo;
> 	else
> 		return bar;
> 
> pattern in multiple patches, please change that to:
> 
> 	if ()
> 		return foo;
> 	return bar;
> 
> Throughout the series.

It's just my personal preference. When the if and else blocks are relatively
short and completely symmetric like the above case, using exlicit if/else
structure looks more immediately intuitive to me. If it isn't too bothersome
to everybody, I'd like to keep it that way.

> Also, if we consider 2s complement, does the above actually make sense?

Maybe we can update jiffifes_to_msecs() to be 2s complement transparent but
probably not a good idea given how many are calling it.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ