From: Peter Zijlstra <peterz@infradead.org>
To: Andi Kleen <ak@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <andi@firstfloor.org>,
linux-toolchains@vger.kernel.org
Subject: Re: [PATCH] sched: Work around undefined behavior in sched class checking
Date: Wed, 5 May 2021 17:34:54 +0200 [thread overview]
Message-ID: <YJK7HlQYAIFVj9fL@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20210505143442.GR4032392@tassilo.jf.intel.com>
On Wed, May 05, 2021 at 07:34:42AM -0700, Andi Kleen wrote:
> > > Use RELOC_HIDE to make this work. This hides the symbols from gcc,
> > > so the optimizer won't make these assumption. I also split
> > > the BUG_ONs in multiple.
> >
> > Urgh, that insanity again :/ Can't we pretty please get a GCC flag to
> > disable that?
>
> Even if that was done (I could totally see the gcc people pushing back on this;
> why should they add special flags just for Linux developers not understanding
> ISO-C?)
I understand C fine, I just don't agree with it. I also want to
explicitly define as much UB as is possible, because UB is just utter
garbage.
So just like we do with -fwrapv and others, add more knobs that
explictly define away UB. Less UB is more better. This being C it's
unlikely we'll ever get to no UB, but we should damn well try :-)
> you would still need the fix for already shipping compilers.
Yes, there is that.
prev parent reply other threads:[~2021-05-05 15:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-05 3:39 [PATCH] sched: Work around undefined behavior in sched class checking Andi Kleen
2021-05-05 6:46 ` Peter Zijlstra
2021-05-05 8:47 ` Florian Weimer
2021-05-05 9:04 ` Peter Zijlstra
2021-05-05 14:39 ` Andi Kleen
2021-05-05 16:41 ` Nick Desaulniers
2021-05-05 16:48 ` Andi Kleen
2021-05-05 17:08 ` Nick Desaulniers
2021-05-05 17:20 ` Andi Kleen
2021-05-05 14:34 ` Andi Kleen
2021-05-05 15:34 ` Peter Zijlstra [this message]
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=YJK7HlQYAIFVj9fL@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-toolchains@vger.kernel.org \
/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