[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <df5a556f-332d-b014-b5ea-44968860acf5@redhat.com>
Date: Wed, 6 Feb 2019 16:59:42 +0100
From: Daniel Bristot de Oliveira <bristot@...hat.com>
To: Masami Hiramatsu <mhiramat@...nel.org>
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>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
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 V4 8/9] jump_label: Batch updates if arch supports it
On 2/6/19 7:34 AM, Masami Hiramatsu wrote:
> On Mon, 4 Feb 2019 20:59:01 +0100
> Daniel Bristot de Oliveira <bristot@...hat.com> wrote:
>
>> --- a/kernel/jump_label.c
>> +++ b/kernel/jump_label.c
>> @@ -407,6 +407,7 @@ bool jump_label_can_update_check(struct jump_entry *entry, bool init)
>> return 0;
>> }
>>
>> +#ifndef HAVE_JUMP_LABEL_BATCH
>> static void __jump_label_update(struct static_key *key,
>> struct jump_entry *entry,
>> struct jump_entry *stop,
>> @@ -419,6 +420,34 @@ static void __jump_label_update(struct static_key *key,
>> }
>> }
>> }
>> +#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();
>
> Please do not relay on BUG(), since in both case (applied or not),
> jump_label is not critical for normal operation. I think you should use
> WARN_ONCE() here and lock the jump_label so that root user can report it
> to us :)
Oops! I wrote a patch changing this, removing the BUG(). It was a request from
steve, but somehow I ended up missing it.
Thanks for reviewing this...
My bad, sorry :-(
-- Daniel
> Thank you,
>
>
Powered by blists - more mailing lists