Re: [PATCHv2] jump_label/x86: Avoid decoding instructions for jump entry size
From: Josh Poimboeuf
Date: Sat Nov 21 2026 - 15:15:52 EST
On Tue, Nov 17, 2026 at 08:55:06PM +0100, Jiri Olsa wrote:
> arch_jump_entry_size() runs the full instruction decoder just to find
> out whether a jump entry is 2 or 5 bytes long. A jump label site can
> only ever hold a JMP8, a JMP32 or the matching 2/5 byte NOP, so the
> size can be determined directly from the opcode byte or by comparing
> against the x86_nops[] encodings.
>
> This matters for kprobe registration, where the address safety check
> calls jump_label_text_reserved(), which walks the jump entries and
> calls arch_jump_entry_size() for each of them. When registering many
> kprobes the instruction decoding dominates the registration time.
>
> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Acked-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
--
Josh