[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170201135103.6b9da1a7@gandalf.local.home>
Date: Wed, 1 Feb 2017 13:51:03 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Jason Baron <jbaron@...mai.com>
Cc: mingo@...nel.org, linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Joe Perches <joe@...ches.com>
Subject: Re: [PATCH v3] jump_label: reduce the size of struct static_key
On Tue, 31 Jan 2017 17:00:43 -0500
Jason Baron <jbaron@...mai.com> wrote:
> --- a/kernel/jump_label.c
> +++ b/kernel/jump_label.c
> @@ -236,12 +236,27 @@ void __weak __init_or_module arch_jump_label_transform_static(struct jump_entry
>
> static inline struct jump_entry *static_key_entries(struct static_key *key)
> {
> - return (struct jump_entry *)((unsigned long)key->entries & ~JUMP_TYPE_MASK);
I wonder if we should add:
WARN_ON_ONCE(key->type & JUMP_TYPE_LINKED);
> + return (struct jump_entry *)(key->type & ~JUMP_TYPE_MASK);
> }
>
[...]
>
> +static inline struct static_key_mod *static_key_mod(struct static_key *key)
> +{
WARN_ON_ONCE(!(key->type & JUMP_TYPE_LINKED));
> + return (struct static_key_mod *)(key->type & ~JUMP_TYPE_MASK);
> +}
> +
-- Steve
Powered by blists - more mailing lists