mmap locking API: initial implementation as rwsem wrappers

Linux Kernel / Linux Kernel - Michel Lespinasse [google.com] - 9 June 2020 16:39 UTC

This patch series adds a new mmap locking API replacing the existing mmap_sem lock and unlocks. Initially the API is just implemente in terms of inlined rwsem calls, so it doesn't provide any new functionality.

There are two justifications for the new API:

- At first, it provides an easy hooking point to instrument mmap_sem locking latencies independently of any other rwsems.

- In the future, it may be a starting point for replacing the rwsem implementation with a different one, such as range locks. This is something that is being explored, even though there is no wide concensus about this possible direction yet. (see https://patchwork.kernel.org/cover/11401483/)

This patch (of 12):

This change wraps the existing mmap_sem related rwsem calls into a new mmap locking API. There are two justifications for the new API:

- At first, it provides an easy hooking point to instrument mmap_sem locking latencies independently of any other rwsems.

- In the future, it may be a starting point for replacing the rwsem implementation with a different one, such as range locks.

9740ca4e95b4 mmap locking API: initial implementation as rwsem wrappers
include/linux/mm.h | 1 +
include/linux/mmap_lock.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)

Upstream: git.kernel.org


  • Share