[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181218153208.6f8bd858@gandalf.local.home>
Date: Tue, 18 Dec 2018 15:32:08 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Daniel Bristot de Oliveira <bristot@...hat.com>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Pavel Tatashin <pasha.tatashin@...cle.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Zhou Chengming <zhouchengming1@...wei.com>,
Jiri Kosina <jkosina@...e.cz>,
Josh Poimboeuf <jpoimboe@...hat.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Chris von Recklinghausen <crecklin@...hat.com>,
Jason Baron <jbaron@...mai.com>, Scott Wood <swood@...hat.com>,
Marcelo Tosatti <mtosatti@...hat.com>,
Clark Williams <williams@...hat.com>, x86@...nel.org
Subject: Re: [PATCH V2 9/9] jump_label: Batch up if arch supports it
On Tue, 18 Dec 2018 20:33:48 +0100
Daniel Bristot de Oliveira <bristot@...hat.com> wrote:
> >> +#else
> >> +static void __jump_label_update(struct static_key *key,
> >> + struct jump_entry *entry,
> >> + struct jump_entry *stop,
> >> + bool init)
> >> +{
> >> + for_each_label_entry(key, entry, stop) {
> >> +
> >> + if (!jump_label_can_update_check(entry, init))
> >> + continue;
> >> +
> >> + if (arch_jump_label_transform_queue(entry,
> >> + jump_label_type(entry)))
> >> + continue;
> >> +
> >> + /*
> >> + * Queue's overflow: Apply the current queue, and then
> >> + * queue again. If it stills not possible to queue, BUG!
> >> + */
> >> + arch_jump_label_transform_apply();
> >> + if (!arch_jump_label_transform_queue(entry,
> >> + jump_label_type(entry))) {
> >> + BUG();
> >
> > Why BUG()? Do you really want to crash Linus's machine?
>
> I am using BUG() because that is what I see in other part of jump_label code:
> If something goes wrong:
> BUG().
Where? Mostly we have BUILD_BUG_ON() which isn't bad at all.
The only other BUG I see in the jump label code is in the arch specific
code and that's from 2012. Lately, we are trying to get rid of BUG()
and panic() entirely, with a few exceptions (where there's really no
way to return. Like when the function graph stack is corrupted, and we
don't know where to go).
If there's a way to continue in a critical state, it's best to WARN()
and continue on. That way, the user can have a chance to see what
happened.
>
> What I could do here is:
>
> Add a "fallback" boll that is disabled by default.
> If I hit this case:
> WARN()
> turn "fallback" on, returning to the old mode (without batch)
>
> Sound better?
Yes, please do.
Thanks!
-- Steve
Powered by blists - more mailing lists