[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241017181859.GB17263@noisy.programming.kicks-ass.net>
Date: Thu, 17 Oct 2024 20:18:59 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Ingo Molnar <mingo@...nel.org>, Uros Bizjak <ubizjak@...il.com>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, Dennis Zhou <dennis@...nel.org>,
Tejun Heo <tj@...nel.org>, Christoph Lameter <cl@...ux.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>
Subject: Re: [PATCH v1 1/1] x86/percpu: Cast -1 to argument type when
comparing in percpu_add_op()
On Wed, Oct 16, 2024 at 12:44:18PM -0700, Dave Hansen wrote:
> Would anybody hate if we broke this up a bit, like:
>
> const typeof(var) _val = val;
> const int paoconst = __builtin_constant_p(val);
> const int paoinc = paoconst && ((_val) == 1);
> const int paodec = paoconst && ((_val) == (typeof(var))-1);
>
> and then did
>
> if (paoinc)
> percpu_unary_op(size, qual, "inc", var);
> ...
I think that is an overall improvement. Proceed! :-)
Powered by blists - more mailing lists