Skip to content

RFC jump_label: Another (better) static_key interface

Peter Zijlstra lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest7 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7jump_label: Rename JUMP_LABEL_{EN,DIS}ABLEarch/arm/kernel/jump_label.c arch/arm64/kernel/jump_label.c arch/mips/kernel/jump_label.c +6 more+18 -180 replies
2/7jump_label: Rename JUMP_LABEL_TYPE_*include/linux/jump_label.h kernel/jump_label.c+21 -290 replies
3/7jump_label: Add jump_entry_key() helperkernel/jump_label.c+10 -50 replies
4/7jump_label: Add static_key_{en,dis}able() helpersinclude/linux/jump_label.h kernel/sched/core.c+22 -40 replies
5/7jump_label: Rework update logickernel/jump_label.c+37 -504 replies
6/7jump_label: Add a new static_key interfacearch/arm/include/asm/jump_label.h arch/arm64/include/asm/jump_label.h arch/mips/include/asm/jump_label.h +6 more+287 -3110 replies
7/7x86, tsc: Employ static_branch_likely()arch/x86/kernel/tsc.c+10 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/7] jump_label: Another (better) static_key interface

Hi all,

After yet another bug because of the weirdness of the static key interface, here an attempt at providing a better one.

This is boot tested on x86_64, bzImage works, modules have a problem. It looks like jump_label_add_module() runs into a 'wrong' NOP, which would indicate jump_label_apply_nops() didn't work right.

I'm too tired to spot the fail, so I figured I'd post it anyway :-)

Beware: x86_64_defconfig has CONFIG_JUMP_LABEL=n.

@arch people, please have a look at patch 6 where I've attempted to do inline asm for all kinds of unknown archs.

---
 arch/arm/include/asm/jump_label.h     |  18 +++-
 arch/arm/kernel/jump_label.c          |   2 +-
 arch/arm64/include/asm/jump_label.h   |  18 +++-
 arch/arm64/kernel/jump_label.c        |   2 +-
 arch/mips/include/asm/jump_label.h    |  19 +++-
 arch/mips/kernel/jump_label.c         |   2 +-
 arch/powerpc/include/asm/jump_label.h |  19 +++-
 arch/powerpc/kernel/jump_label.c      |   2 +-
 arch/s390/include/asm/jump_label.h    |  19 +++-
 arch/s390/kernel/jump_label.c         |   2 +-
 arch/sparc/include/asm/jump_label.h   |  34 ++++--
 arch/sparc/kernel/jump_label.c        |   2 +-
 arch/x86/include/asm/jump_label.h     |  21 +++-
 arch/x86/kernel/jump_label.c          |   2 +-
 arch/x86/kernel/tsc.c                 |  22 ++--
 include/linux/jump_label.h            | 188 +++++++++++++++++++++++++++++-----
 kernel/jump_label.c                   | 114 ++++++++++++---------
 kernel/sched/core.c                   |   6 +-
 18 files changed, 374 insertions(+), 118 deletions(-)