[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <23C8FA53-2D16-4A77-BC2A-98CE32AE317C@gmail.com>
Date: Tue, 4 Aug 2015 14:50:32 +0800
From: yalin wang <yalin.wang2010@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org,
jasonbaron0@...il.com, bp@...en8.de, luto@...capital.net,
tglx@...utronix.de, rostedt@...dmis.org, will.deacon@....com,
liuj97@...il.com, rabin@....in, ralf@...ux-mips.org,
ddaney@...iumnetworks.com, benh@...nel.crashing.org,
michael@...erman.id.au, heiko.carstens@...ibm.com,
davem@...emloft.net, vbabka@...e.cz
Subject: Re: [PATCH -v2 6/8] jump_label: Add a new static_key interface
> On Jul 28, 2015, at 21:21, Peter Zijlstra <peterz@...radead.org> wrote:
>
> There are various problems and short-comings with the current
> static_key interface:
>
> - static_key_{true,false}() read like a branch depending on the key
> value, instead of the actual likely/unlikely branch depending on
> init value.
>
> - static_key_{true,false}() are, as stated above, tied to the
> static_key init values STATIC_KEY_INIT_{TRUE,FALSE}.
>
> - we're limited to the 2 (out of 4) possible options that compile to
> a default NOP because that's what our arch_static_branch() assembly
> emits.
>
> So provide a new static_key interface:
>
> DEFINE_STATIC_KEY_TRUE(name);
> DEFINE_STATIC_KEY_FALSE(name);
>
> Which define a key of different types with an initial true/false
> value.
>
> Then allow:
>
> static_branch_likely()
> static_branch_unlikely()
>
> to take a key of either type and emit the right instruction for the
> case.
>
> This means adding a second arch_static_branch_jump() assembly helper
> which emits a JMP per default.
>
> In order to determine the right instruction for the right state,
> encode the branch type in the LSB of jump_entry::key.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
>
is this means static_key_{true,false}() are deprecated ?
do you need mark static_key_{true,false}() as deprecated?
like this:
static __always_inline __deprecated bool static_key_false(struct static_key *key) ?
Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists