[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZNCXT+nRHnTKJX0y@dhcp22.suse.cz>
Date: Mon, 7 Aug 2023 09:03:43 +0200
From: Michal Hocko <mhocko@...e.com>
To: Doug Anderson <dianders@...omium.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Petr Mladek <pmladek@...e.com>, Arnd Bergmann <arnd@...db.de>,
Borislav Petkov <bp@...en8.de>,
Christophe Leroy <christophe.leroy@...roup.eu>,
"Darrick J. Wong" <djwong@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"David S. Miller" <davem@...emloft.net>,
Gaosheng Cui <cuigaosheng1@...wei.com>,
"Gautham R. Shenoy" <gautham.shenoy@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Guilherme G. Piccoli" <gpiccoli@...lia.com>,
Guo Ren <guoren@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
Huacai Chen <chenhuacai@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
"Jason A. Donenfeld" <Jason@...c4.com>,
Jianmin Lv <lvjianmin@...ngson.cn>,
Jinyang He <hejinyang@...ngson.cn>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Kees Cook <keescook@...omium.org>,
Lecopzer Chen <lecopzer.chen@...iatek.com>,
Marc Zyngier <maz@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
"Paul E. McKenney" <paulmck@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Pingfan Liu <kernelfans@...il.com>,
Qing Zhang <zhangqing@...ngson.cn>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Russell King <linux@...linux.org.uk>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Thomas Gleixner <tglx@...utronix.de>,
Tom Rix <trix@...hat.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Valentin Schneider <vschneid@...hat.com>,
WANG Xuerui <kernel@...0n.name>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mips@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
loongarch@...ts.linux.dev, sparclinux@...r.kernel.org,
x86@...nel.org
Subject: Re: [PATCH v3 1/2] nmi_backtrace: Allow excluding an arbitrary CPU
On Fri 04-08-23 09:06:07, Doug Anderson wrote:
> Hi,
>
> On Fri, Aug 4, 2023 at 8:02 AM Michal Hocko <mhocko@...e.com> wrote:
> >
> > > > It would have been slightly safer to modify arch_trigger_cpumask_backtrace
> > > > by switching arguments so that some leftovers are captured easier.
> > >
> > > I'm not sure I understand. Oh, you're saying make the prototype of
> > > arch_trigger_cpumask_backtrace() incompatible so that if someone is
> > > directly calling it then it'll be a compile-time error?
> >
> > exactly. bool to int promotion would be too easy to miss while the
> > pointer to int would complain loudly.
> >
> > > I guess the
> > > hope is that nobody is calling that directly and they're calling
> > > through the trigger_...() functions.
> >
> > Hope is one thing, being preventive another.
> >
> > > For now I'm going to leave this alone.
> >
> > If you are going to send another version then please consider this. Not
> > a hard requirement but better.
>
> If I do send another version, do you have any suggestions for how to
> change this to make it incompatible?
I would swap parameters as this seems simplest.
> I guess swapping the order of the
> parameters would be best? I considered doing that for v4 but I felt
> like long term the current order of the parameters was better.
Yes the current ordering is better but having it other way around is not
really horrendous either.
> I also
> considered a rename, but that different problems. ;-) If I rename both
> the #define and the function then if someone has an out-of-tree patch
> adding arch_trigger_cpumask_backtrace() for another architecture, like
> say arm64, then there would be no compile-time failure indicating that
> the out-of-tree patch needs updating. I could rename the functions but
> _not_ the #define, I guess?
I think that swapping would be simplest as the type mismatch should
catch also pending out-of-tree potential implementations.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists