Skip to content

MIPS: Select the R10000 LL/SC workaround at boot

Imre Kaloz bpf linux-mips lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5MIPS: Use SC_BEQZ in the futex and sysmips ll/sc loopsarch/mips/include/asm/futex.h arch/mips/kernel/syscall.c+4 -30 replies
2/5MIPS: Select the R10000 LL/SC workaround at bootarch/mips/Kconfig arch/mips/include/asm/asm.h arch/mips/include/asm/r10k-llsc.h +6 more+166 -40 replies
3/5MIPS: SGI-IP27: Report all CPUs to the R10000 LL/SC workaroundarch/mips/sgi-ip27/ip27-smp.c+2 -00 replies
4/5MIPS: tlbex: Follow the boot-time R10000 LL/SC choicearch/mips/mm/tlbex.c+2 -10 replies
5/5bpf, mips: Follow the boot-time R10000 LL/SC choicearch/mips/net/bpf_jit_comp.c arch/mips/net/bpf_jit_comp.h arch/mips/net/bpf_jit_comp32.c +1 more+14 -90 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/5] MIPS: Select the R10000 LL/SC workaround at boot

Kernels for IP27, IP28 and IP30 select CONFIG_WAR_R10000_LLSC, which retries ll/sc sequences with a branch-likely that only R10000s before revision 3.0 need. On an R12000 Octane, dropping it makes fork, pipe, futex and file creation 1-4% faster.

This series keeps it built in and decides at boot. Unless an affected CPU is present, sc branches become beqz, modules are patched at load, and tlbex and the BPF JIT emit beqz.

Patch 3 conflicts in context with the IP35 series' "MIPS: SGI-IP27:
give each CPU its own topology package id"; it resolves in one line.

Patch 5 depends on patch 2, so I'd like the whole series to go through the MIPS tree, with an Acked-by from the BPF maintainers on patch 5.

Tested on an R12000 Octane, and the BPF JIT with test_bpf on QEMU 64-bit Malta. No R10000 before revision 3.0 was available.

Imre Kaloz (5):
MIPS: Use SC_BEQZ in the futex and sysmips ll/sc loops
MIPS: Select the R10000 LL/SC workaround at boot
MIPS: SGI-IP27: Report all CPUs to the R10000 LL/SC workaround
MIPS: tlbex: Follow the boot-time R10000 LL/SC choice bpf, mips: Follow the boot-time R10000 LL/SC choice

 arch/mips/Kconfig                 |   5 +-
 arch/mips/include/asm/asm.h       |   7 +-
 arch/mips/include/asm/futex.h     |   5 +-
 arch/mips/include/asm/r10k-llsc.h |  29 ++++++++
 arch/mips/kernel/Makefile         |   1 +
 arch/mips/kernel/module.c         |   5 ++
 arch/mips/kernel/r10k-llsc.c      | 111 ++++++++++++++++++++++++++++++
 arch/mips/kernel/setup.c          |   2 +
 arch/mips/kernel/smp.c            |   2 +
 arch/mips/kernel/syscall.c        |   2 +-
 arch/mips/kernel/vmlinux.lds.S    |   8 +++
 arch/mips/mm/tlbex.c              |   3 +-
 arch/mips/net/bpf_jit_comp.c      |   5 +-
 arch/mips/net/bpf_jit_comp.h      |  12 ++--
 arch/mips/net/bpf_jit_comp32.c    |   1 +
 arch/mips/net/bpf_jit_comp64.c    |   5 +-
 arch/mips/sgi-ip27/ip27-smp.c     |   2 +
 17 files changed, 188 insertions(+), 17 deletions(-)
 create mode 100644 arch/mips/include/asm/r10k-llsc.h
 create mode 100644 arch/mips/kernel/r10k-llsc.c

base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907

Signature · 1 line
2.47.3