Skip to content

membarrier updates for 4.16

Mathieu Desnoyers linux-api linux-arch linux-kselftest linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11membarrier: selftest: Test private expedited cmd (v2)tools/testing/selftests/membarrier/membarrier_test.c+95 -160 replies
2/11powerpc: membarrier: Skip memory barrier in switch_mm() (v7)MAINTAINERS arch/powerpc/Kconfig arch/powerpc/include/asm/membarrier.h +5 more+58 -110 replies
3/11membarrier: Document scheduler barrier requirements (v5)arch/x86/mm/tlb.c include/linux/sched/mm.h kernel/sched/core.c+36 -110 replies
4/11membarrier: provide GLOBAL_EXPEDITED command (v3)arch/powerpc/include/asm/membarrier.h include/linux/sched/mm.h include/uapi/linux/membarrier.h +1 more+153 -180 replies
5/11membarrier: selftest: Test global expedited cmd (v2)tools/testing/selftests/membarrier/membarrier_test.c+54 -50 replies
6/11Introduce sync_core_before_usermodeinclude/linux/processor.h init/Kconfig+9 -00 replies
7/11x86: Implement sync_core_before_usermode (v3)arch/x86/Kconfig arch/x86/include/asm/processor.h+11 -05 replies
8/11membarrier: Provide core serializing commandinclude/linux/sched/mm.h include/uapi/linux/membarrier.h init/Kconfig +2 more+98 -140 replies
9/11membarrier: x86: Provide core serializing command (v4)arch/x86/Kconfig arch/x86/entry/entry_32.S arch/x86/entry/entry_64.S +1 more+14 -30 replies
10/11membarrier: arm64: Provide core serializing commandarch/arm64/Kconfig arch/arm64/kernel/entry.S+5 -00 replies
11/11membarrier: selftest: Test private expedited sync core cmdtools/testing/selftests/membarrier/membarrier_test.c+73 -00 replies

Reviews trailers per patch

4 of 11 patches have a Reviewed-by or Acked-by.

PatchShuah KhanGreg Kroah-HartmanThomas Gleixner
1/11A-b A-b
2/11
3/11
4/11
5/11A-b
6/11
7/11R-b
8/11
9/11
10/11
11/11A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH for 4.16 00/11] membarrier updates for 4.16

Hi Ingo, Peter, Thomas,

Here is the updated membarrier patch series following review from Thomas.

It would be appreciated of those can go through the scheduler tree for the 4.16 merge window.

Highlights:

"powerpc: membarrier: Skip memory barrier in switch_mm()" takes care of a TODO that was left in the private expedited implementation when merged in 4.14: an extra memory barrier was added on context switch on powerpc. Ensure that the barrier is only performed when scheduling between different processes, only for threads belonging to processes that have registered their intent to use the private expedited command.

"membarrier: provide GLOBAL_EXPEDITED command" adds new commands to membarrier for registration and use of membarrier across processes communicating through shared memory mappings. The non-expedited command has proven to be really too slow (taking 10ms and more to complete) for real-world use. The expedited version completes in a matter of microseconds. This patch renames the pre-existing MEMBARRIER_CMD_SHARED to MEMBARRIER_CMD_GLOBAL for consistency, keeping the old enum label as an alias for backward compatibility.

"membarrier: Provide core serializing command" provides core serialization for JIT reclaim. We received positive feedback from Android developers that the proposed ABI fits their use-case. Only x86 32/64 and arm 64 implement this command so far. This is opt-in per architecture.

The other patches add selftests and documentation.

Thanks,

Mathieu

Mathieu Desnoyers (11):
membarrier: selftest: Test private expedited cmd (v2)
powerpc: membarrier: Skip memory barrier in switch_mm() (v7)
membarrier: Document scheduler barrier requirements (v5)
membarrier: provide GLOBAL_EXPEDITED command (v3)
membarrier: selftest: Test global expedited cmd (v2) Introduce sync_core_before_usermode
x86: Implement sync_core_before_usermode (v3)
membarrier: Provide core serializing command
membarrier: x86: Provide core serializing command (v4)
membarrier: arm64: Provide core serializing command
membarrier: selftest: Test private expedited sync core cmd

 MAINTAINERS                                        |   1 +
 arch/arm64/Kconfig                                 |   1 +
 arch/arm64/kernel/entry.S                          |   4 +
 arch/powerpc/Kconfig                               |   1 +
 arch/powerpc/include/asm/membarrier.h              |  27 +++
 arch/powerpc/mm/mmu_context.c                      |   7 +
 arch/x86/Kconfig                                   |   2 +
 arch/x86/entry/entry_32.S                          |   5 +
 arch/x86/entry/entry_64.S                          |   4 +
 arch/x86/include/asm/processor.h                   |  10 +
 arch/x86/mm/tlb.c                                  |   6 +
 include/linux/processor.h                          |   6 +
 include/linux/sched/mm.h                           |  40 +++-
 include/uapi/linux/membarrier.h                    |  74 ++++++-
 init/Kconfig                                       |   9 +
 kernel/sched/core.c                                |  53 +++--
 kernel/sched/membarrier.c                          | 177 +++++++++++++--
 .../testing/selftests/membarrier/membarrier_test.c | 237 +++++++++++++++++++--
 18 files changed, 596 insertions(+), 68 deletions(-)
 create mode 100644 arch/powerpc/include/asm/membarrier.h
Signature · 1 line
2.11.0