mm/highmem: Preemptible variant of kmap_atomic & friends
Status from this message: The following commit has been merged into the sched/core branch of tip:
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest8 patches 31 repliesApplied
- v337 patches 8 repliesApplied
- v218 patches 31 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 RFC | 15 patches | 38 replies | Superseded |
Changes in v4 from the cover letter
- Rebased on top of the merged consolidation patches and on top of the latest version of migrate disable support.
- New debug features (enforced mappings)
- Dropped the conversion patches as they need review from the respective subsystems and better go through the relevant trees for 5.12
Patches in v4 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | mm/highmem: Provide and use CONFIG_DEBUG_KMAP_LOCALinclude/ lib/ mm/ | +11 | 0 replies | |
| 2/8 | mm/highmem: Provide CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAPlib/ mm/ | +25 | 3 replies | |
| 3/8 | x86: Support kmap_local() forced debuggingarch/ arch/ arch/ | +15 | 10 replies | |
| 4/8 | sched: Make migrate_disable/enable() independent of RTinclude/ include/ include/ +3 more | +56 | 13 replies | |
| 5/8 | sched: highmem: Store local kmaps in task structinclude/ include/ kernel/ +3 more | +129 | 4 replies | |
| 6/8 | mm/highmem: Provide kmap_local*include/ include/ mm/ | +81 | 0 replies | |
| 7/8 | io-mapping: Provide iomap_local variantDocumentation/ include/ | +74 | 0 replies | |
| 8/8 | x86/crashdump/32: Simplify copy_oldmem_page()arch/ | +10 | 0 replies |
Reviews trailers per patch
None of the 8 patches has a Reviewed-by or Acked-by.
| Patch | Peter Zijlstra (Intel) | Steven Rostedt (VMware) |
|---|---|---|
| Series | Grudgingly-Acked-by | |
| 1/8 | ||
| 2/8 | ||
| 3/8 | T-b | |
| 4/8 | ||
| 5/8 | ||
| 6/8 | ||
| 7/8 | ||
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [patch V4 0/8] mm/highmem: Preemptible variant of kmap_atomic & friends
This is the outstanding set of patches for the preemptible kmap_*() implementation. The previous version is here:
https://lore.kernel.org/r/[email protected]
The following changes come with it:
- Better debugging for kmap* by enforcing the temporary mappings even for lowmem pages when the architecture allows it.
- Support for enforced mappings on X86 for both 32 and 64 bit. As KMAP_LOCAL is already independent from HIGHMEM this needs only the extra fixmap space on 64bit and no further code changes.
- Removing the RT dependency from migrate_disable/enable(). This patch still needs some help from the scheduler folks vs. the comment in preempt.h.
- Switching from per CPU storage of the kmap index to a per task storage by adding a pteval array to the per task storage which contains the ptevals of the currently active temporary kmaps
- Adding context switch code which checks whether the outgoing or the incoming task has active temporary kmaps. If so, the outgoing task's kmaps are removed and the incoming task's kmaps are restored.
- Adding new interfaces k[un]map_local*() which are not disabling preemption and can be called from any context (except NMI).
Contrary to kmap() which provides preemptible and "persistant" mappings, these interfaces are meant to replace the temporary mappings provided by kmap_atomic*() today.
This allows to get rid of conditional mapping choices and allows to have preemptible short term "mappings" on 64bit which are today enforced to be non-preemptible due to the highmem constraints. It clearly puts overhead on the highmem users, but highmem is slow anyway.
This is not a wholesale conversion which makes kmap_atomic magically preemptible because there might be usage sites which rely on the implicit preempt disable. So this needs to be done on a case by case basis and the call sites converted to kmap_local().
Changes vs. V3:
- Rebased on top of the merged consolidation patches and on top of the latest version of migrate disable support.
- New debug features (enforced mappings)
- Dropped the conversion patches as they need review from the respective subsystems and better go through the relevant trees for 5.12
The series is based on
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/mm
with
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
merged in.
It is also available from git:
git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git highmem
Thanks,
tglx
--- Documentation/driver-api/io-mapping.rst | 74 +++++++++++-------- arch/x86/Kconfig | 1 arch/x86/include/asm/fixmap.h | 12 ++- arch/x86/include/asm/pgtable_64_types.h | 6 + arch/x86/kernel/crash_dump_32.c | 48 ++---------- include/asm-generic/kmap_size.h | 2 include/linux/highmem-internal.h | 58 +++++++++++++++ include/linux/highmem.h | 43 +++++++---- include/linux/io-mapping.h | 30 +++++++ include/linux/kernel.h | 21 +++-- include/linux/preempt.h | 38 ---------- include/linux/sched.h | 11 ++ kernel/entry/common.c | 2 kernel/fork.c | 1 kernel/sched/core.c | 63 ++++++++++++++-- kernel/sched/sched.h | 4 - lib/Kconfig.debug | 22 +++++ lib/smp_processor_id.c | 2 mm/highmem.c | 121 ++++++++++++++++++++++++++++---- 19 files changed, 400 insertions(+), 159 deletions(-)