Skip to content

Commit a5c93bf

Browse files
committed
Merge tag 'x86-mm-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 mm updates from Ingo Molnar: - Put cpumask_test_cpu() check in switch_mm_irqs_off() under CONFIG_DEBUG_VM, to micro-optimize the context-switching code (Rik van Riel) - Add missing details in virtual memory layout (Kirill A. Shutemov) * tag 'x86-mm-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm/tlb: Put cpumask_test_cpu() check in switch_mm_irqs_off() under CONFIG_DEBUG_VM x86/mm/doc: Add missing details in virtual memory layout
2 parents 89c45f3 + 7e33001 commit a5c93bf

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

Documentation/arch/x86/x86_64/mm.rst

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,27 @@ Complete virtual memory map with 4-level page tables
2929
Start addr | Offset | End addr | Size | VM area description
3030
========================================================================================================================
3131
| | | |
32-
0000000000000000 | 0 | 00007fffffffffff | 128 TB | user-space virtual memory, different per mm
32+
0000000000000000 | 0 | 00007fffffffefff | ~128 TB | user-space virtual memory, different per mm
33+
00007ffffffff000 | ~128 TB | 00007fffffffffff | 4 kB | ... guard hole
3334
__________________|____________|__________________|_________|___________________________________________________________
3435
| | | |
35-
0000800000000000 | +128 TB | ffff7fffffffffff | ~16M TB | ... huge, almost 64 bits wide hole of non-canonical
36-
| | | | virtual memory addresses up to the -128 TB
36+
0000800000000000 | +128 TB | 7fffffffffffffff | ~8 EB | ... huge, almost 63 bits wide hole of non-canonical
37+
| | | | virtual memory addresses up to the -8 EB
3738
| | | | starting offset of kernel mappings.
39+
| | | |
40+
| | | | LAM relaxes canonicallity check allowing to create aliases
41+
| | | | for userspace memory here.
3842
__________________|____________|__________________|_________|___________________________________________________________
3943
|
4044
| Kernel-space virtual memory, shared between all processes:
45+
__________________|____________|__________________|_________|___________________________________________________________
46+
| | | |
47+
8000000000000000 | -8 EB | ffff7fffffffffff | ~8 EB | ... huge, almost 63 bits wide hole of non-canonical
48+
| | | | virtual memory addresses up to the -128 TB
49+
| | | | starting offset of kernel mappings.
50+
| | | |
51+
| | | | LAM_SUP relaxes canonicallity check allowing to create
52+
| | | | aliases for kernel memory here.
4153
____________________________________________________________|___________________________________________________________
4254
| | | |
4355
ffff800000000000 | -128 TB | ffff87ffffffffff | 8 TB | ... guard hole, also reserved for hypervisor
@@ -88,15 +100,26 @@ Complete virtual memory map with 5-level page tables
88100
Start addr | Offset | End addr | Size | VM area description
89101
========================================================================================================================
90102
| | | |
91-
0000000000000000 | 0 | 00ffffffffffffff | 64 PB | user-space virtual memory, different per mm
103+
0000000000000000 | 0 | 00fffffffffff000 | ~64 PB | user-space virtual memory, different per mm
104+
00fffffffffff000 | ~64 PB | 00ffffffffffffff | 4 kB | ... guard hole
92105
__________________|____________|__________________|_________|___________________________________________________________
93106
| | | |
94-
0100000000000000 | +64 PB | feffffffffffffff | ~16K PB | ... huge, still almost 64 bits wide hole of non-canonical
95-
| | | | virtual memory addresses up to the -64 PB
107+
0100000000000000 | +64 PB | 7fffffffffffffff | ~8 EB | ... huge, almost 63 bits wide hole of non-canonical
108+
| | | | virtual memory addresses up to the -8EB TB
96109
| | | | starting offset of kernel mappings.
110+
| | | |
111+
| | | | LAM relaxes canonicallity check allowing to create aliases
112+
| | | | for userspace memory here.
97113
__________________|____________|__________________|_________|___________________________________________________________
98114
|
99115
| Kernel-space virtual memory, shared between all processes:
116+
____________________________________________________________|___________________________________________________________
117+
8000000000000000 | -8 EB | feffffffffffffff | ~8 EB | ... huge, almost 63 bits wide hole of non-canonical
118+
| | | | virtual memory addresses up to the -64 PB
119+
| | | | starting offset of kernel mappings.
120+
| | | |
121+
| | | | LAM_SUP relaxes canonicallity check allowing to create
122+
| | | | aliases for kernel memory here.
100123
____________________________________________________________|___________________________________________________________
101124
| | | |
102125
ff00000000000000 | -64 PB | ff0fffffffffffff | 4 PB | ... guard hole, also reserved for hypervisor

arch/x86/mm/tlb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ void switch_mm_irqs_off(struct mm_struct *unused, struct mm_struct *next,
568568
* mm_cpumask. The TLB shootdown code can figure out from
569569
* cpu_tlbstate_shared.is_lazy whether or not to send an IPI.
570570
*/
571-
if (WARN_ON_ONCE(prev != &init_mm &&
571+
if (IS_ENABLED(CONFIG_DEBUG_VM) && WARN_ON_ONCE(prev != &init_mm &&
572572
!cpumask_test_cpu(cpu, mm_cpumask(next))))
573573
cpumask_set_cpu(cpu, mm_cpumask(next));
574574

0 commit comments

Comments
 (0)