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: <Z-J5UEFwM3gh6VXR@gmail.com>
Date: Tue, 25 Mar 2025 10:37:20 +0100
From: Ingo Molnar <mingo@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org,
	Shrikanth Hegde <sshegde@...ux.ibm.com>,
	Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
	Valentin Schneider <vschneid@...hat.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>, x86@...nel.org
Subject: Re: [tip: sched/core] sched/debug: Change SCHED_WARN_ON() to
 WARN_ON_ONCE()


* Peter Zijlstra <peterz@...radead.org> wrote:

> On Thu, Mar 20, 2025 at 09:00:05AM -0000, tip-bot2 for Ingo Molnar wrote:
> > The following commit has been merged into the sched/core branch of tip:
> > 
> > Commit-ID:     f7d2728cc032a23fccb5ecde69793a38eb30ba5c
> > Gitweb:        https://git.kernel.org/tip/f7d2728cc032a23fccb5ecde69793a38eb30ba5c
> > Author:        Ingo Molnar <mingo@...nel.org>
> > AuthorDate:    Mon, 17 Mar 2025 11:42:52 +01:00
> > Committer:     Ingo Molnar <mingo@...nel.org>
> > CommitterDate: Wed, 19 Mar 2025 22:20:53 +01:00
> > 
> > sched/debug: Change SCHED_WARN_ON() to WARN_ON_ONCE()
> > 
> > The scheduler has this special SCHED_WARN() facility that
> > depends on CONFIG_SCHED_DEBUG.
> > 
> > Since CONFIG_SCHED_DEBUG is getting removed, convert
> > SCHED_WARN() to WARN_ON_ONCE().
> > 
> > Note that the warning output isn't 100% equivalent:
> > 
> >    #define SCHED_WARN_ON(x)      WARN_ONCE(x, #x)
> > 
> > Because SCHED_WARN_ON() would output the 'x' condition
> > as well, while WARN_ONCE() will only show a backtrace.
> > 
> > Hopefully these are rare enough to not really matter.
> > 
> > If it does, we should probably introduce a new WARN_ON()
> > variant that outputs the condition in stringified form,
> > or improve WARN_ON() itself.
> 
> So those strings really were useful, trouble is WARN_ONCE() generates
> utter crap code compared to WARN_ON_ONCE(), but since SCHED_DEBUG that
> doesn't really matter.

Why wouldn't it matter? CONFIG_SCHED_DEBUG was turned on for 99.9999% 
of Linux users, ie. we generated crap code for most of our users.

And as a side effect of using the standard WARN_ON_ONCE() primitive we 
now generate better code, at the expense of harder to interpret debug 
output, right?

Ie. CONFIG_SCHED_DEBUG has obfuscated crappy code generation under the 
"it's only debugging code" pretense, right?

> Also, last time I measured, there was a measurable performance
> difference between SCHED_DEBUG=n and SCHED_DEBUG=y.

Which 99.9999% of Linux users are affected by. The config option 
basically did nothing for them but hide this overhead...

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ