Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86: remove PG_uncached

Convert x86 to use PG_arch_2 instead of PG_uncached and remove
PG_uncached.

Link: https://lkml.kernel.org/r/20240821193445.2294269-11-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
7a87225a 02e1960a

+31 -76
-30
Documentation/features/vm/PG_uncached/arch-support.txt
··· 1 - # 2 - # Feature name: PG_uncached 3 - # Kconfig: ARCH_USES_PG_UNCACHED 4 - # description: arch supports the PG_uncached page flag 5 - # 6 - ----------------------- 7 - | arch |status| 8 - ----------------------- 9 - | alpha: | TODO | 10 - | arc: | TODO | 11 - | arm: | TODO | 12 - | arm64: | TODO | 13 - | csky: | TODO | 14 - | hexagon: | TODO | 15 - | loongarch: | TODO | 16 - | m68k: | TODO | 17 - | microblaze: | TODO | 18 - | mips: | TODO | 19 - | nios2: | TODO | 20 - | openrisc: | TODO | 21 - | parisc: | TODO | 22 - | powerpc: | TODO | 23 - | riscv: | TODO | 24 - | s390: | TODO | 25 - | sh: | TODO | 26 - | sparc: | TODO | 27 - | um: | TODO | 28 - | x86: | ok | 29 - | xtensa: | TODO | 30 - -----------------------
+2 -1
arch/arm64/Kconfig
··· 2100 2100 depends on ARM64_PAN 2101 2101 select ARCH_HAS_SUBPAGE_FAULTS 2102 2102 select ARCH_USES_HIGH_VMA_FLAGS 2103 - select ARCH_USES_PG_ARCH_X 2103 + select ARCH_USES_PG_ARCH_2 2104 + select ARCH_USES_PG_ARCH_3 2104 2105 help 2105 2106 Memory Tagging (part of the ARMv8.5 Extensions) provides 2106 2107 architectural support for run-time, always-on detection of
+1 -4
arch/x86/Kconfig
··· 1799 1799 def_bool y 1800 1800 prompt "x86 PAT support" if EXPERT 1801 1801 depends on MTRR 1802 + select ARCH_USES_PG_ARCH_2 1802 1803 help 1803 1804 Use PAT attributes to setup page level cache control. 1804 1805 ··· 1810 1809 spontaneous reboots) or a non-working video driver. 1811 1810 1812 1811 If unsure, say Y. 1813 - 1814 - config ARCH_USES_PG_UNCACHED 1815 - def_bool y 1816 - depends on X86_PAT 1817 1812 1818 1813 config X86_UMIP 1819 1814 def_bool y
+4 -4
arch/x86/mm/pat/memtype.c
··· 104 104 105 105 #ifdef CONFIG_X86_PAT 106 106 /* 107 - * X86 PAT uses page flags arch_1 and uncached together to keep track of 107 + * X86 PAT uses page flags arch_1 and arch_2 together to keep track of 108 108 * memory type of pages that have backing page struct. 109 109 * 110 110 * X86 PAT supports 4 different memory types: ··· 118 118 119 119 #define _PGMT_WB 0 120 120 #define _PGMT_WC (1UL << PG_arch_1) 121 - #define _PGMT_UC_MINUS (1UL << PG_uncached) 122 - #define _PGMT_WT (1UL << PG_uncached | 1UL << PG_arch_1) 123 - #define _PGMT_MASK (1UL << PG_uncached | 1UL << PG_arch_1) 121 + #define _PGMT_UC_MINUS (1UL << PG_arch_2) 122 + #define _PGMT_WT (1UL << PG_arch_2 | 1UL << PG_arch_1) 123 + #define _PGMT_MASK (1UL << PG_arch_2 | 1UL << PG_arch_1) 124 124 #define _PGMT_CLEAR_MASK (~_PGMT_MASK) 125 125 126 126 static inline enum page_cache_mode get_page_memtype(struct page *pg)
+3 -5
fs/proc/page.c
··· 206 206 u |= kpf_copy_bit(page->flags, KPF_HWPOISON, PG_hwpoison); 207 207 #endif 208 208 209 - #ifdef CONFIG_ARCH_USES_PG_UNCACHED 210 - u |= kpf_copy_bit(k, KPF_UNCACHED, PG_uncached); 211 - #endif 212 - 213 209 u |= kpf_copy_bit(k, KPF_RESERVED, PG_reserved); 214 210 u |= kpf_copy_bit(k, KPF_OWNER_2, PG_owner_2); 215 211 u |= kpf_copy_bit(k, KPF_PRIVATE, PG_private); 216 212 u |= kpf_copy_bit(k, KPF_PRIVATE_2, PG_private_2); 217 213 u |= kpf_copy_bit(k, KPF_OWNER_PRIVATE, PG_owner_priv_1); 218 214 u |= kpf_copy_bit(k, KPF_ARCH, PG_arch_1); 219 - #ifdef CONFIG_ARCH_USES_PG_ARCH_X 215 + #ifdef CONFIG_ARCH_USES_PG_ARCH_2 220 216 u |= kpf_copy_bit(k, KPF_ARCH_2, PG_arch_2); 217 + #endif 218 + #ifdef CONFIG_ARCH_USES_PG_ARCH_3 221 219 u |= kpf_copy_bit(k, KPF_ARCH_3, PG_arch_3); 222 220 #endif 223 221
-1
include/linux/kernel-page-flags.h
··· 15 15 #define KPF_PRIVATE_2 36 16 16 #define KPF_OWNER_PRIVATE 37 17 17 #define KPF_ARCH 38 18 - #define KPF_UNCACHED 39 19 18 #define KPF_SOFTDIRTY 40 20 19 #define KPF_ARCH_2 41 21 20 #define KPF_ARCH_3 42
+3 -10
include/linux/page-flags.h
··· 113 113 #ifdef CONFIG_MMU 114 114 PG_mlocked, /* Page is vma mlocked */ 115 115 #endif 116 - #ifdef CONFIG_ARCH_USES_PG_UNCACHED 117 - PG_uncached, /* Page has been mapped as uncached */ 118 - #endif 119 116 #ifdef CONFIG_MEMORY_FAILURE 120 117 PG_hwpoison, /* hardware poisoned page. Don't touch */ 121 118 #endif ··· 120 123 PG_young, 121 124 PG_idle, 122 125 #endif 123 - #ifdef CONFIG_ARCH_USES_PG_ARCH_X 126 + #ifdef CONFIG_ARCH_USES_PG_ARCH_2 124 127 PG_arch_2, 128 + #endif 129 + #ifdef CONFIG_ARCH_USES_PG_ARCH_3 125 130 PG_arch_3, 126 131 #endif 127 132 __NR_PAGEFLAGS, ··· 599 600 __FOLIO_CLEAR_FLAG_NOOP(mlocked) 600 601 FOLIO_TEST_CLEAR_FLAG_FALSE(mlocked) 601 602 FOLIO_TEST_SET_FLAG_FALSE(mlocked) 602 - #endif 603 - 604 - #ifdef CONFIG_ARCH_USES_PG_UNCACHED 605 - PAGEFLAG(Uncached, uncached, PF_NO_COMPOUND) 606 - #else 607 - PAGEFLAG_FALSE(Uncached, uncached) 608 603 #endif 609 604 610 605 #ifdef CONFIG_MEMORY_FAILURE
+11 -12
include/trace/events/mmflags.h
··· 71 71 #define IF_HAVE_PG_MLOCK(_name) 72 72 #endif 73 73 74 - #ifdef CONFIG_ARCH_USES_PG_UNCACHED 75 - #define IF_HAVE_PG_UNCACHED(_name) ,{1UL << PG_##_name, __stringify(_name)} 76 - #else 77 - #define IF_HAVE_PG_UNCACHED(_name) 78 - #endif 79 - 80 74 #ifdef CONFIG_MEMORY_FAILURE 81 75 #define IF_HAVE_PG_HWPOISON(_name) ,{1UL << PG_##_name, __stringify(_name)} 82 76 #else ··· 83 89 #define IF_HAVE_PG_IDLE(_name) 84 90 #endif 85 91 86 - #ifdef CONFIG_ARCH_USES_PG_ARCH_X 87 - #define IF_HAVE_PG_ARCH_X(_name) ,{1UL << PG_##_name, __stringify(_name)} 92 + #ifdef CONFIG_ARCH_USES_PG_ARCH_2 93 + #define IF_HAVE_PG_ARCH_2(_name) ,{1UL << PG_##_name, __stringify(_name)} 88 94 #else 89 - #define IF_HAVE_PG_ARCH_X(_name) 95 + #define IF_HAVE_PG_ARCH_2(_name) 96 + #endif 97 + 98 + #ifdef CONFIG_ARCH_USES_PG_ARCH_3 99 + #define IF_HAVE_PG_ARCH_3(_name) ,{1UL << PG_##_name, __stringify(_name)} 100 + #else 101 + #define IF_HAVE_PG_ARCH_3(_name) 90 102 #endif 91 103 92 104 #define DEF_PAGEFLAG_NAME(_name) { 1UL << PG_##_name, __stringify(_name) } ··· 118 118 DEF_PAGEFLAG_NAME(swapbacked), \ 119 119 DEF_PAGEFLAG_NAME(unevictable) \ 120 120 IF_HAVE_PG_MLOCK(mlocked) \ 121 - IF_HAVE_PG_UNCACHED(uncached) \ 122 121 IF_HAVE_PG_HWPOISON(hwpoison) \ 123 122 IF_HAVE_PG_IDLE(idle) \ 124 123 IF_HAVE_PG_IDLE(young) \ 125 - IF_HAVE_PG_ARCH_X(arch_2) \ 126 - IF_HAVE_PG_ARCH_X(arch_3) 124 + IF_HAVE_PG_ARCH_2(arch_2) \ 125 + IF_HAVE_PG_ARCH_3(arch_3) 127 126 128 127 #define show_page_flags(flags) \ 129 128 (flags) ? __print_flags(flags, "|", \
+3 -6
mm/Kconfig
··· 1079 1079 config ARCH_HAS_PKEYS 1080 1080 bool 1081 1081 1082 - config ARCH_USES_PG_ARCH_X 1082 + config ARCH_USES_PG_ARCH_2 1083 1083 bool 1084 - help 1085 - Enable the definition of PG_arch_x page flags with x > 1. Only 1086 - suitable for 64-bit architectures with CONFIG_FLATMEM or 1087 - CONFIG_SPARSEMEM_VMEMMAP enabled, otherwise there may not be 1088 - enough room for additional bits in page->flags. 1084 + config ARCH_USES_PG_ARCH_3 1085 + bool 1089 1086 1090 1087 config VM_EVENT_COUNTERS 1091 1088 default y
+3 -1
mm/huge_memory.c
··· 2993 2993 (1L << PG_workingset) | 2994 2994 (1L << PG_locked) | 2995 2995 (1L << PG_unevictable) | 2996 - #ifdef CONFIG_ARCH_USES_PG_ARCH_X 2996 + #ifdef CONFIG_ARCH_USES_PG_ARCH_2 2997 2997 (1L << PG_arch_2) | 2998 + #endif 2999 + #ifdef CONFIG_ARCH_USES_PG_ARCH_3 2998 3000 (1L << PG_arch_3) | 2999 3001 #endif 3000 3002 (1L << PG_dirty) |
+1 -2
tools/mm/page-types.c
··· 76 76 #define KPF_PRIVATE_2 36 77 77 #define KPF_OWNER_PRIVATE 37 78 78 #define KPF_ARCH 38 79 - #define KPF_UNCACHED 39 79 + #define KPF_UNCACHED 39 /* unused */ 80 80 #define KPF_SOFTDIRTY 40 81 81 #define KPF_ARCH_2 41 82 82 ··· 134 134 [KPF_PRIVATE_2] = "p:private_2", 135 135 [KPF_OWNER_PRIVATE] = "O:owner_private", 136 136 [KPF_ARCH] = "h:arch", 137 - [KPF_UNCACHED] = "c:uncached", 138 137 [KPF_SOFTDIRTY] = "f:softdirty", 139 138 [KPF_ARCH_2] = "H:arch_2", 140 139