lkml.org 
[lkml]   [2019]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V5 6/7] jump_label: Batch updates if arch supports it
On Mon, Apr 01, 2019 at 10:58:18AM +0200, Daniel Bristot de Oliveira wrote:
> +int fallback_batch __read_mostly;
> +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(entry, init))
> + continue;
> +
> + if (unlikely(fallback_batch)) {
> + arch_jump_label_transform(entry, jump_label_type(entry));
> + continue;
> + }
> +
> + if (!arch_jump_label_transform_queue(entry, jump_label_type(entry)))
> + continue;

That reads wrong; 'if we cannot queue, continue'

> +
> + /*
> + * Queue's overflow: Apply the current queue, and then try to
> + * queue again. If it stills fail to queue, fallback to the
> + * non-batch mode!
> + */
> + arch_jump_label_transform_apply();
> +
> + if (arch_jump_label_transform_queue(entry, jump_label_type(entry))) {
> + WARN(1, "jump_label: batch mode failure!\n");
> + fallback_batch = 1;
> + arch_jump_label_transform(entry, jump_label_type(entry));
> + }
> + }
> + arch_jump_label_transform_apply();
> +}

Hurmph...

for_each_whatever(entry, stop, key) {
if (!jump_label_can_update(entry, init))
continue;

if (!arch_jump_label_transform_queue(entry)) {
/* queue full, flush */
arch_jump_label_transform_apply();
BUG_ON(!arch_jump_label_transform_queue(entry));
}
}
arch_jump_label_transform_apply();

Also, see next patch.

\
 
 \ /
  Last update: 2019-04-15 13:51    [W:0.065 / U:5.592 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site