[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180420165139.GP4064@hirez.programming.kicks-ass.net>
Date: Fri, 20 Apr 2018 18:51:39 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Philipp Klocke <Phil_K97@....de>
Cc: lukas.bulwahn@...il.com, kernelnewbies@...nelnewbies.org,
llvmlinux@...ts.linuxfoundation.org, sil2review@...ts.osadl.org,
der.herr@...r.at, Ingo Molnar <mingo@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/fair: Change sched_feat(x) in !CONFIG_SCHED_DEBUG
case
On Fri, Apr 20, 2018 at 06:29:07PM +0200, Philipp Klocke wrote:
> The gain is stopping a warning that clutters the output log of clang.
Well, you should not be using clang anyway. It is known to miscompile
the kernel.
> To improve readability, one can drop the ifdef-structure and just keep
> the right shift version, like Nicholas suggested. This will have a (very
> small)
> impact on performance in CONFIG_SCHED_DEBUG case, but when
> debugging, performance is no problem anyways.
See that is two bad choices.
> > Also, if sysctl_sched_features is a constant, the both expressions
> > _should_ really result in a constant and clang should still warn about
> > it.
> No, because clang only warns if the constant is neither 1 nor 0.
> (These being the 'best' integer representations of booleans)
Then won't something like so work?
#define sched_feat(x) !!(sysctl_sched_features & (1UL << __SCHED_FEAT_##x))
That forces it into _Bool space (0/1) and per the above rule will no
longer warn.
Powered by blists - more mailing lists