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.

Merge branch 'akpm' (patches from Andrew)

Merge more updates from Andrew Morton:
"Subsystems affected by this patch series: mm/hotfixes, lz4, exec,
mailmap, mm/thp, autofs, sysctl, mm/kmemleak, mm/misc and lib"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (35 commits)
virtio: pci: constify ioreadX() iomem argument (as in generic implementation)
ntb: intel: constify ioreadX() iomem argument (as in generic implementation)
rtl818x: constify ioreadX() iomem argument (as in generic implementation)
iomap: constify ioreadX() iomem argument (as in generic implementation)
sh: use generic strncpy()
sh: clkfwk: remove r8/r16/r32
include/asm-generic/vmlinux.lds.h: align ro_after_init
mm: annotate a data race in page_zonenum()
mm/swap.c: annotate data races for lru_rotate_pvecs
mm/rmap: annotate a data race at tlb_flush_batched
mm/mempool: fix a data race in mempool_free()
mm/list_lru: fix a data race in list_lru_count_one
mm/memcontrol: fix a data race in scan count
mm/page_counter: fix various data races at memsw
mm/swapfile: fix and annotate various data races
mm/filemap.c: fix a data race in filemap_fault()
mm/swap_state: mark various intentional data races
mm/page_io: mark various intentional data races
mm/frontswap: mark various intentional data races
mm/kmemleak: silence KCSAN splats in checksum
...

+596 -566
+1
.mailmap
··· 104 104 Greg Kroah-Hartman <greg@echidna.(none)> 105 105 Greg Kroah-Hartman <gregkh@suse.de> 106 106 Greg Kroah-Hartman <greg@kroah.com> 107 + Greg Kurz <groug@kaod.org> <gkurz@linux.vnet.ibm.com> 107 108 Gregory CLEMENT <gregory.clement@bootlin.com> <gregory.clement@free-electrons.com> 108 109 Hanjun Guo <guohanjun@huawei.com> <hanjun.guo@linaro.org> 109 110 Heiko Carstens <hca@linux.ibm.com> <h.carstens@de.ibm.com>
+3 -3
arch/alpha/include/asm/core_apecs.h
··· 384 384 } \ 385 385 } while (0) 386 386 387 - __EXTERN_INLINE unsigned int apecs_ioread8(void __iomem *xaddr) 387 + __EXTERN_INLINE unsigned int apecs_ioread8(const void __iomem *xaddr) 388 388 { 389 389 unsigned long addr = (unsigned long) xaddr; 390 390 unsigned long result, base_and_type; ··· 420 420 *(vuip) ((addr << 5) + base_and_type) = w; 421 421 } 422 422 423 - __EXTERN_INLINE unsigned int apecs_ioread16(void __iomem *xaddr) 423 + __EXTERN_INLINE unsigned int apecs_ioread16(const void __iomem *xaddr) 424 424 { 425 425 unsigned long addr = (unsigned long) xaddr; 426 426 unsigned long result, base_and_type; ··· 456 456 *(vuip) ((addr << 5) + base_and_type) = w; 457 457 } 458 458 459 - __EXTERN_INLINE unsigned int apecs_ioread32(void __iomem *xaddr) 459 + __EXTERN_INLINE unsigned int apecs_ioread32(const void __iomem *xaddr) 460 460 { 461 461 unsigned long addr = (unsigned long) xaddr; 462 462 if (addr < APECS_DENSE_MEM)
+3 -3
arch/alpha/include/asm/core_cia.h
··· 342 342 #define vuip volatile unsigned int __force * 343 343 #define vulp volatile unsigned long __force * 344 344 345 - __EXTERN_INLINE unsigned int cia_ioread8(void __iomem *xaddr) 345 + __EXTERN_INLINE unsigned int cia_ioread8(const void __iomem *xaddr) 346 346 { 347 347 unsigned long addr = (unsigned long) xaddr; 348 348 unsigned long result, base_and_type; ··· 374 374 *(vuip) ((addr << 5) + base_and_type) = w; 375 375 } 376 376 377 - __EXTERN_INLINE unsigned int cia_ioread16(void __iomem *xaddr) 377 + __EXTERN_INLINE unsigned int cia_ioread16(const void __iomem *xaddr) 378 378 { 379 379 unsigned long addr = (unsigned long) xaddr; 380 380 unsigned long result, base_and_type; ··· 404 404 *(vuip) ((addr << 5) + base_and_type) = w; 405 405 } 406 406 407 - __EXTERN_INLINE unsigned int cia_ioread32(void __iomem *xaddr) 407 + __EXTERN_INLINE unsigned int cia_ioread32(const void __iomem *xaddr) 408 408 { 409 409 unsigned long addr = (unsigned long) xaddr; 410 410 if (addr < CIA_DENSE_MEM)
+3 -3
arch/alpha/include/asm/core_lca.h
··· 230 230 } while (0) 231 231 232 232 233 - __EXTERN_INLINE unsigned int lca_ioread8(void __iomem *xaddr) 233 + __EXTERN_INLINE unsigned int lca_ioread8(const void __iomem *xaddr) 234 234 { 235 235 unsigned long addr = (unsigned long) xaddr; 236 236 unsigned long result, base_and_type; ··· 266 266 *(vuip) ((addr << 5) + base_and_type) = w; 267 267 } 268 268 269 - __EXTERN_INLINE unsigned int lca_ioread16(void __iomem *xaddr) 269 + __EXTERN_INLINE unsigned int lca_ioread16(const void __iomem *xaddr) 270 270 { 271 271 unsigned long addr = (unsigned long) xaddr; 272 272 unsigned long result, base_and_type; ··· 302 302 *(vuip) ((addr << 5) + base_and_type) = w; 303 303 } 304 304 305 - __EXTERN_INLINE unsigned int lca_ioread32(void __iomem *xaddr) 305 + __EXTERN_INLINE unsigned int lca_ioread32(const void __iomem *xaddr) 306 306 { 307 307 unsigned long addr = (unsigned long) xaddr; 308 308 if (addr < LCA_DENSE_MEM)
+2 -2
arch/alpha/include/asm/core_marvel.h
··· 332 332 #define vucp volatile unsigned char __force * 333 333 #define vusp volatile unsigned short __force * 334 334 335 - extern unsigned int marvel_ioread8(void __iomem *); 335 + extern unsigned int marvel_ioread8(const void __iomem *); 336 336 extern void marvel_iowrite8(u8 b, void __iomem *); 337 337 338 - __EXTERN_INLINE unsigned int marvel_ioread16(void __iomem *addr) 338 + __EXTERN_INLINE unsigned int marvel_ioread16(const void __iomem *addr) 339 339 { 340 340 return __kernel_ldwu(*(vusp)addr); 341 341 }
+3 -3
arch/alpha/include/asm/core_mcpcia.h
··· 267 267 return (addr & 0x80000000UL) == 0; 268 268 } 269 269 270 - __EXTERN_INLINE unsigned int mcpcia_ioread8(void __iomem *xaddr) 270 + __EXTERN_INLINE unsigned int mcpcia_ioread8(const void __iomem *xaddr) 271 271 { 272 272 unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK; 273 273 unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK; ··· 291 291 *(vuip) ((addr << 5) + hose + 0x00) = w; 292 292 } 293 293 294 - __EXTERN_INLINE unsigned int mcpcia_ioread16(void __iomem *xaddr) 294 + __EXTERN_INLINE unsigned int mcpcia_ioread16(const void __iomem *xaddr) 295 295 { 296 296 unsigned long addr = (unsigned long)xaddr & MCPCIA_MEM_MASK; 297 297 unsigned long hose = (unsigned long)xaddr & ~MCPCIA_MEM_MASK; ··· 315 315 *(vuip) ((addr << 5) + hose + 0x08) = w; 316 316 } 317 317 318 - __EXTERN_INLINE unsigned int mcpcia_ioread32(void __iomem *xaddr) 318 + __EXTERN_INLINE unsigned int mcpcia_ioread32(const void __iomem *xaddr) 319 319 { 320 320 unsigned long addr = (unsigned long)xaddr; 321 321
+1 -1
arch/alpha/include/asm/core_t2.h
··· 572 572 it doesn't make sense to merge the pio and mmio routines. */ 573 573 574 574 #define IOPORT(OS, NS) \ 575 - __EXTERN_INLINE unsigned int t2_ioread##NS(void __iomem *xaddr) \ 575 + __EXTERN_INLINE unsigned int t2_ioread##NS(const void __iomem *xaddr) \ 576 576 { \ 577 577 if (t2_is_mmio(xaddr)) \ 578 578 return t2_read##OS(xaddr); \
+6 -6
arch/alpha/include/asm/io.h
··· 150 150 alpha_mv.mv_##NAME(b, addr); \ 151 151 } 152 152 153 - REMAP1(unsigned int, ioread8, /**/) 154 - REMAP1(unsigned int, ioread16, /**/) 155 - REMAP1(unsigned int, ioread32, /**/) 153 + REMAP1(unsigned int, ioread8, const) 154 + REMAP1(unsigned int, ioread16, const) 155 + REMAP1(unsigned int, ioread32, const) 156 156 REMAP1(u8, readb, const volatile) 157 157 REMAP1(u16, readw, const volatile) 158 158 REMAP1(u32, readl, const volatile) ··· 307 307 */ 308 308 309 309 #if IO_CONCAT(__IO_PREFIX,trivial_io_bw) 310 - extern inline unsigned int ioread8(void __iomem *addr) 310 + extern inline unsigned int ioread8(const void __iomem *addr) 311 311 { 312 312 unsigned int ret; 313 313 mb(); ··· 316 316 return ret; 317 317 } 318 318 319 - extern inline unsigned int ioread16(void __iomem *addr) 319 + extern inline unsigned int ioread16(const void __iomem *addr) 320 320 { 321 321 unsigned int ret; 322 322 mb(); ··· 359 359 #endif 360 360 361 361 #if IO_CONCAT(__IO_PREFIX,trivial_io_lq) 362 - extern inline unsigned int ioread32(void __iomem *addr) 362 + extern inline unsigned int ioread32(const void __iomem *addr) 363 363 { 364 364 unsigned int ret; 365 365 mb();
+8 -8
arch/alpha/include/asm/io_trivial.h
··· 7 7 8 8 #if IO_CONCAT(__IO_PREFIX,trivial_io_bw) 9 9 __EXTERN_INLINE unsigned int 10 - IO_CONCAT(__IO_PREFIX,ioread8)(void __iomem *a) 10 + IO_CONCAT(__IO_PREFIX,ioread8)(const void __iomem *a) 11 11 { 12 - return __kernel_ldbu(*(volatile u8 __force *)a); 12 + return __kernel_ldbu(*(const volatile u8 __force *)a); 13 13 } 14 14 15 15 __EXTERN_INLINE unsigned int 16 - IO_CONCAT(__IO_PREFIX,ioread16)(void __iomem *a) 16 + IO_CONCAT(__IO_PREFIX,ioread16)(const void __iomem *a) 17 17 { 18 - return __kernel_ldwu(*(volatile u16 __force *)a); 18 + return __kernel_ldwu(*(const volatile u16 __force *)a); 19 19 } 20 20 21 21 __EXTERN_INLINE void ··· 33 33 34 34 #if IO_CONCAT(__IO_PREFIX,trivial_io_lq) 35 35 __EXTERN_INLINE unsigned int 36 - IO_CONCAT(__IO_PREFIX,ioread32)(void __iomem *a) 36 + IO_CONCAT(__IO_PREFIX,ioread32)(const void __iomem *a) 37 37 { 38 - return *(volatile u32 __force *)a; 38 + return *(const volatile u32 __force *)a; 39 39 } 40 40 41 41 __EXTERN_INLINE void ··· 73 73 __EXTERN_INLINE u8 74 74 IO_CONCAT(__IO_PREFIX,readb)(const volatile void __iomem *a) 75 75 { 76 - void __iomem *addr = (void __iomem *)a; 76 + const void __iomem *addr = (const void __iomem *)a; 77 77 return IO_CONCAT(__IO_PREFIX,ioread8)(addr); 78 78 } 79 79 80 80 __EXTERN_INLINE u16 81 81 IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a) 82 82 { 83 - void __iomem *addr = (void __iomem *)a; 83 + const void __iomem *addr = (const void __iomem *)a; 84 84 return IO_CONCAT(__IO_PREFIX,ioread16)(addr); 85 85 } 86 86
+1 -1
arch/alpha/include/asm/jensen.h
··· 305 305 that it doesn't make sense to merge them. */ 306 306 307 307 #define IOPORT(OS, NS) \ 308 - __EXTERN_INLINE unsigned int jensen_ioread##NS(void __iomem *xaddr) \ 308 + __EXTERN_INLINE unsigned int jensen_ioread##NS(const void __iomem *xaddr) \ 309 309 { \ 310 310 if (jensen_is_mmio(xaddr)) \ 311 311 return jensen_read##OS(xaddr - 0x100000000ul); \
+3 -3
arch/alpha/include/asm/machvec.h
··· 46 46 void (*mv_pci_tbi)(struct pci_controller *hose, 47 47 dma_addr_t start, dma_addr_t end); 48 48 49 - unsigned int (*mv_ioread8)(void __iomem *); 50 - unsigned int (*mv_ioread16)(void __iomem *); 51 - unsigned int (*mv_ioread32)(void __iomem *); 49 + unsigned int (*mv_ioread8)(const void __iomem *); 50 + unsigned int (*mv_ioread16)(const void __iomem *); 51 + unsigned int (*mv_ioread32)(const void __iomem *); 52 52 53 53 void (*mv_iowrite8)(u8, void __iomem *); 54 54 void (*mv_iowrite16)(u16, void __iomem *);
+1 -1
arch/alpha/kernel/core_marvel.c
··· 806 806 } 807 807 808 808 unsigned int 809 - marvel_ioread8(void __iomem *xaddr) 809 + marvel_ioread8(const void __iomem *xaddr) 810 810 { 811 811 unsigned long addr = (unsigned long) xaddr; 812 812 if (__marvel_is_port_kbd(addr))
+6 -6
arch/alpha/kernel/io.c
··· 14 14 "generic", which bumps through the machine vector. */ 15 15 16 16 unsigned int 17 - ioread8(void __iomem *addr) 17 + ioread8(const void __iomem *addr) 18 18 { 19 19 unsigned int ret; 20 20 mb(); ··· 23 23 return ret; 24 24 } 25 25 26 - unsigned int ioread16(void __iomem *addr) 26 + unsigned int ioread16(const void __iomem *addr) 27 27 { 28 28 unsigned int ret; 29 29 mb(); ··· 32 32 return ret; 33 33 } 34 34 35 - unsigned int ioread32(void __iomem *addr) 35 + unsigned int ioread32(const void __iomem *addr) 36 36 { 37 37 unsigned int ret; 38 38 mb(); ··· 257 257 /* 258 258 * Read COUNT 8-bit bytes from port PORT into memory starting at SRC. 259 259 */ 260 - void ioread8_rep(void __iomem *port, void *dst, unsigned long count) 260 + void ioread8_rep(const void __iomem *port, void *dst, unsigned long count) 261 261 { 262 262 while ((unsigned long)dst & 0x3) { 263 263 if (!count) ··· 300 300 * the interfaces seems to be slow: just using the inlined version 301 301 * of the inw() breaks things. 302 302 */ 303 - void ioread16_rep(void __iomem *port, void *dst, unsigned long count) 303 + void ioread16_rep(const void __iomem *port, void *dst, unsigned long count) 304 304 { 305 305 if (unlikely((unsigned long)dst & 0x3)) { 306 306 if (!count) ··· 340 340 * but the interfaces seems to be slow: just using the inlined version 341 341 * of the inl() breaks things. 342 342 */ 343 - void ioread32_rep(void __iomem *port, void *dst, unsigned long count) 343 + void ioread32_rep(const void __iomem *port, void *dst, unsigned long count) 344 344 { 345 345 if (unlikely((unsigned long)dst & 0x3)) { 346 346 while (count--) {
+1 -1
arch/alpha/kernel/syscalls/syscall.tbl
··· 249 249 316 common mlockall sys_mlockall 250 250 317 common munlockall sys_munlockall 251 251 318 common sysinfo sys_sysinfo 252 - 319 common _sysctl sys_sysctl 252 + 319 common _sysctl sys_ni_syscall 253 253 # 320 was sys_idle 254 254 321 common oldumount sys_oldumount 255 255 322 common swapon sys_swapon
-1
arch/arm/configs/am200epdkit_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_SYSFS_DEPRECATED_V2=y 5 5 CONFIG_EXPERT=y 6 - # CONFIG_SYSCTL_SYSCALL is not set 7 6 # CONFIG_EPOLL is not set 8 7 # CONFIG_SHMEM is not set 9 8 # CONFIG_VM_EVENT_COUNTERS is not set
+1 -1
arch/arm/tools/syscall.tbl
··· 162 162 146 common writev sys_writev 163 163 147 common getsid sys_getsid 164 164 148 common fdatasync sys_fdatasync 165 - 149 common _sysctl sys_sysctl 165 + 149 common _sysctl sys_ni_syscall 166 166 150 common mlock sys_mlock 167 167 151 common munlock sys_munlock 168 168 152 common mlockall sys_mlockall
+2 -2
arch/arm64/include/asm/unistd32.h
··· 308 308 __SYSCALL(__NR_getsid, sys_getsid) 309 309 #define __NR_fdatasync 148 310 310 __SYSCALL(__NR_fdatasync, sys_fdatasync) 311 - #define __NR__sysctl 149 312 - __SYSCALL(__NR__sysctl, compat_sys_sysctl) 311 + /* 149 was sys_sysctl */ 312 + __SYSCALL(149, sys_ni_syscall) 313 313 #define __NR_mlock 150 314 314 __SYSCALL(__NR_mlock, sys_mlock) 315 315 #define __NR_munlock 151
+1 -1
arch/ia64/kernel/syscalls/syscall.tbl
··· 135 135 123 common writev sys_writev 136 136 124 common pread64 sys_pread64 137 137 125 common pwrite64 sys_pwrite64 138 - 126 common _sysctl sys_sysctl 138 + 126 common _sysctl sys_ni_syscall 139 139 127 common mmap sys_mmap 140 140 128 common munmap sys_munmap 141 141 129 common mlock sys_mlock
+1 -1
arch/m68k/kernel/syscalls/syscall.tbl
··· 156 156 146 common writev sys_writev 157 157 147 common getsid sys_getsid 158 158 148 common fdatasync sys_fdatasync 159 - 149 common _sysctl sys_sysctl 159 + 149 common _sysctl sys_ni_syscall 160 160 150 common mlock sys_mlock 161 161 151 common munlock sys_munlock 162 162 152 common mlockall sys_mlockall
+1 -1
arch/microblaze/kernel/syscalls/syscall.tbl
··· 156 156 146 common writev sys_writev 157 157 147 common getsid sys_getsid 158 158 148 common fdatasync sys_fdatasync 159 - 149 common _sysctl sys_sysctl 159 + 149 common _sysctl sys_ni_syscall 160 160 150 common mlock sys_mlock 161 161 151 common munlock sys_munlock 162 162 152 common mlockall sys_mlockall
-1
arch/mips/configs/cu1000-neo_defconfig
··· 17 17 CONFIG_NAMESPACES=y 18 18 CONFIG_USER_NS=y 19 19 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 20 - CONFIG_SYSCTL_SYSCALL=y 21 20 CONFIG_KALLSYMS_ALL=y 22 21 CONFIG_EMBEDDED=y 23 22 # CONFIG_VM_EVENT_COUNTERS is not set
+1 -1
arch/mips/kernel/syscalls/syscall_n32.tbl
··· 159 159 149 n32 munlockall sys_munlockall 160 160 150 n32 vhangup sys_vhangup 161 161 151 n32 pivot_root sys_pivot_root 162 - 152 n32 _sysctl compat_sys_sysctl 162 + 152 n32 _sysctl sys_ni_syscall 163 163 153 n32 prctl sys_prctl 164 164 154 n32 adjtimex sys_adjtimex_time32 165 165 155 n32 setrlimit compat_sys_setrlimit
+1 -1
arch/mips/kernel/syscalls/syscall_n64.tbl
··· 159 159 149 n64 munlockall sys_munlockall 160 160 150 n64 vhangup sys_vhangup 161 161 151 n64 pivot_root sys_pivot_root 162 - 152 n64 _sysctl sys_sysctl 162 + 152 n64 _sysctl sys_ni_syscall 163 163 153 n64 prctl sys_prctl 164 164 154 n64 adjtimex sys_adjtimex 165 165 155 n64 setrlimit sys_setrlimit
+1 -1
arch/mips/kernel/syscalls/syscall_o32.tbl
··· 164 164 150 o32 unused150 sys_ni_syscall 165 165 151 o32 getsid sys_getsid 166 166 152 o32 fdatasync sys_fdatasync 167 - 153 o32 _sysctl sys_sysctl compat_sys_sysctl 167 + 153 o32 _sysctl sys_ni_syscall 168 168 154 o32 mlock sys_mlock 169 169 155 o32 munlock sys_munlock 170 170 156 o32 mlockall sys_mlockall
+2 -2
arch/parisc/include/asm/io.h
··· 303 303 #define ioread64be ioread64be 304 304 #define iowrite64 iowrite64 305 305 #define iowrite64be iowrite64be 306 - extern u64 ioread64(void __iomem *addr); 307 - extern u64 ioread64be(void __iomem *addr); 306 + extern u64 ioread64(const void __iomem *addr); 307 + extern u64 ioread64be(const void __iomem *addr); 308 308 extern void iowrite64(u64 val, void __iomem *addr); 309 309 extern void iowrite64be(u64 val, void __iomem *addr); 310 310
+1 -1
arch/parisc/kernel/syscalls/syscall.tbl
··· 163 163 146 common writev sys_writev compat_sys_writev 164 164 147 common getsid sys_getsid 165 165 148 common fdatasync sys_fdatasync 166 - 149 common _sysctl sys_sysctl compat_sys_sysctl 166 + 149 common _sysctl sys_ni_syscall 167 167 150 common mlock sys_mlock 168 168 151 common munlock sys_munlock 169 169 152 common mlockall sys_mlockall
+36 -36
arch/parisc/lib/iomap.c
··· 43 43 #endif 44 44 45 45 struct iomap_ops { 46 - unsigned int (*read8)(void __iomem *); 47 - unsigned int (*read16)(void __iomem *); 48 - unsigned int (*read16be)(void __iomem *); 49 - unsigned int (*read32)(void __iomem *); 50 - unsigned int (*read32be)(void __iomem *); 51 - u64 (*read64)(void __iomem *); 52 - u64 (*read64be)(void __iomem *); 46 + unsigned int (*read8)(const void __iomem *); 47 + unsigned int (*read16)(const void __iomem *); 48 + unsigned int (*read16be)(const void __iomem *); 49 + unsigned int (*read32)(const void __iomem *); 50 + unsigned int (*read32be)(const void __iomem *); 51 + u64 (*read64)(const void __iomem *); 52 + u64 (*read64be)(const void __iomem *); 53 53 void (*write8)(u8, void __iomem *); 54 54 void (*write16)(u16, void __iomem *); 55 55 void (*write16be)(u16, void __iomem *); ··· 57 57 void (*write32be)(u32, void __iomem *); 58 58 void (*write64)(u64, void __iomem *); 59 59 void (*write64be)(u64, void __iomem *); 60 - void (*read8r)(void __iomem *, void *, unsigned long); 61 - void (*read16r)(void __iomem *, void *, unsigned long); 62 - void (*read32r)(void __iomem *, void *, unsigned long); 60 + void (*read8r)(const void __iomem *, void *, unsigned long); 61 + void (*read16r)(const void __iomem *, void *, unsigned long); 62 + void (*read32r)(const void __iomem *, void *, unsigned long); 63 63 void (*write8r)(void __iomem *, const void *, unsigned long); 64 64 void (*write16r)(void __iomem *, const void *, unsigned long); 65 65 void (*write32r)(void __iomem *, const void *, unsigned long); ··· 69 69 70 70 #define ADDR2PORT(addr) ((unsigned long __force)(addr) & 0xffffff) 71 71 72 - static unsigned int ioport_read8(void __iomem *addr) 72 + static unsigned int ioport_read8(const void __iomem *addr) 73 73 { 74 74 return inb(ADDR2PORT(addr)); 75 75 } 76 76 77 - static unsigned int ioport_read16(void __iomem *addr) 77 + static unsigned int ioport_read16(const void __iomem *addr) 78 78 { 79 79 return inw(ADDR2PORT(addr)); 80 80 } 81 81 82 - static unsigned int ioport_read32(void __iomem *addr) 82 + static unsigned int ioport_read32(const void __iomem *addr) 83 83 { 84 84 return inl(ADDR2PORT(addr)); 85 85 } ··· 99 99 outl(datum, ADDR2PORT(addr)); 100 100 } 101 101 102 - static void ioport_read8r(void __iomem *addr, void *dst, unsigned long count) 102 + static void ioport_read8r(const void __iomem *addr, void *dst, unsigned long count) 103 103 { 104 104 insb(ADDR2PORT(addr), dst, count); 105 105 } 106 106 107 - static void ioport_read16r(void __iomem *addr, void *dst, unsigned long count) 107 + static void ioport_read16r(const void __iomem *addr, void *dst, unsigned long count) 108 108 { 109 109 insw(ADDR2PORT(addr), dst, count); 110 110 } 111 111 112 - static void ioport_read32r(void __iomem *addr, void *dst, unsigned long count) 112 + static void ioport_read32r(const void __iomem *addr, void *dst, unsigned long count) 113 113 { 114 114 insl(ADDR2PORT(addr), dst, count); 115 115 } ··· 150 150 151 151 /* Legacy I/O memory ops */ 152 152 153 - static unsigned int iomem_read8(void __iomem *addr) 153 + static unsigned int iomem_read8(const void __iomem *addr) 154 154 { 155 155 return readb(addr); 156 156 } 157 157 158 - static unsigned int iomem_read16(void __iomem *addr) 158 + static unsigned int iomem_read16(const void __iomem *addr) 159 159 { 160 160 return readw(addr); 161 161 } 162 162 163 - static unsigned int iomem_read16be(void __iomem *addr) 163 + static unsigned int iomem_read16be(const void __iomem *addr) 164 164 { 165 165 return __raw_readw(addr); 166 166 } 167 167 168 - static unsigned int iomem_read32(void __iomem *addr) 168 + static unsigned int iomem_read32(const void __iomem *addr) 169 169 { 170 170 return readl(addr); 171 171 } 172 172 173 - static unsigned int iomem_read32be(void __iomem *addr) 173 + static unsigned int iomem_read32be(const void __iomem *addr) 174 174 { 175 175 return __raw_readl(addr); 176 176 } 177 177 178 - static u64 iomem_read64(void __iomem *addr) 178 + static u64 iomem_read64(const void __iomem *addr) 179 179 { 180 180 return readq(addr); 181 181 } 182 182 183 - static u64 iomem_read64be(void __iomem *addr) 183 + static u64 iomem_read64be(const void __iomem *addr) 184 184 { 185 185 return __raw_readq(addr); 186 186 } ··· 220 220 __raw_writel(datum, addr); 221 221 } 222 222 223 - static void iomem_read8r(void __iomem *addr, void *dst, unsigned long count) 223 + static void iomem_read8r(const void __iomem *addr, void *dst, unsigned long count) 224 224 { 225 225 while (count--) { 226 226 *(u8 *)dst = __raw_readb(addr); ··· 228 228 } 229 229 } 230 230 231 - static void iomem_read16r(void __iomem *addr, void *dst, unsigned long count) 231 + static void iomem_read16r(const void __iomem *addr, void *dst, unsigned long count) 232 232 { 233 233 while (count--) { 234 234 *(u16 *)dst = __raw_readw(addr); ··· 236 236 } 237 237 } 238 238 239 - static void iomem_read32r(void __iomem *addr, void *dst, unsigned long count) 239 + static void iomem_read32r(const void __iomem *addr, void *dst, unsigned long count) 240 240 { 241 241 while (count--) { 242 242 *(u32 *)dst = __raw_readl(addr); ··· 297 297 }; 298 298 299 299 300 - unsigned int ioread8(void __iomem *addr) 300 + unsigned int ioread8(const void __iomem *addr) 301 301 { 302 302 if (unlikely(INDIRECT_ADDR(addr))) 303 303 return iomap_ops[ADDR_TO_REGION(addr)]->read8(addr); 304 304 return *((u8 *)addr); 305 305 } 306 306 307 - unsigned int ioread16(void __iomem *addr) 307 + unsigned int ioread16(const void __iomem *addr) 308 308 { 309 309 if (unlikely(INDIRECT_ADDR(addr))) 310 310 return iomap_ops[ADDR_TO_REGION(addr)]->read16(addr); 311 311 return le16_to_cpup((u16 *)addr); 312 312 } 313 313 314 - unsigned int ioread16be(void __iomem *addr) 314 + unsigned int ioread16be(const void __iomem *addr) 315 315 { 316 316 if (unlikely(INDIRECT_ADDR(addr))) 317 317 return iomap_ops[ADDR_TO_REGION(addr)]->read16be(addr); 318 318 return *((u16 *)addr); 319 319 } 320 320 321 - unsigned int ioread32(void __iomem *addr) 321 + unsigned int ioread32(const void __iomem *addr) 322 322 { 323 323 if (unlikely(INDIRECT_ADDR(addr))) 324 324 return iomap_ops[ADDR_TO_REGION(addr)]->read32(addr); 325 325 return le32_to_cpup((u32 *)addr); 326 326 } 327 327 328 - unsigned int ioread32be(void __iomem *addr) 328 + unsigned int ioread32be(const void __iomem *addr) 329 329 { 330 330 if (unlikely(INDIRECT_ADDR(addr))) 331 331 return iomap_ops[ADDR_TO_REGION(addr)]->read32be(addr); 332 332 return *((u32 *)addr); 333 333 } 334 334 335 - u64 ioread64(void __iomem *addr) 335 + u64 ioread64(const void __iomem *addr) 336 336 { 337 337 if (unlikely(INDIRECT_ADDR(addr))) 338 338 return iomap_ops[ADDR_TO_REGION(addr)]->read64(addr); 339 339 return le64_to_cpup((u64 *)addr); 340 340 } 341 341 342 - u64 ioread64be(void __iomem *addr) 342 + u64 ioread64be(const void __iomem *addr) 343 343 { 344 344 if (unlikely(INDIRECT_ADDR(addr))) 345 345 return iomap_ops[ADDR_TO_REGION(addr)]->read64be(addr); ··· 411 411 412 412 /* Repeating interfaces */ 413 413 414 - void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) 414 + void ioread8_rep(const void __iomem *addr, void *dst, unsigned long count) 415 415 { 416 416 if (unlikely(INDIRECT_ADDR(addr))) { 417 417 iomap_ops[ADDR_TO_REGION(addr)]->read8r(addr, dst, count); ··· 423 423 } 424 424 } 425 425 426 - void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) 426 + void ioread16_rep(const void __iomem *addr, void *dst, unsigned long count) 427 427 { 428 428 if (unlikely(INDIRECT_ADDR(addr))) { 429 429 iomap_ops[ADDR_TO_REGION(addr)]->read16r(addr, dst, count); ··· 435 435 } 436 436 } 437 437 438 - void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) 438 + void ioread32_rep(const void __iomem *addr, void *dst, unsigned long count) 439 439 { 440 440 if (unlikely(INDIRECT_ADDR(addr))) { 441 441 iomap_ops[ADDR_TO_REGION(addr)]->read32r(addr, dst, count);
+14 -14
arch/powerpc/kernel/iomap.c
··· 15 15 * Here comes the ppc64 implementation of the IOMAP 16 16 * interfaces. 17 17 */ 18 - unsigned int ioread8(void __iomem *addr) 18 + unsigned int ioread8(const void __iomem *addr) 19 19 { 20 20 return readb(addr); 21 21 } 22 - unsigned int ioread16(void __iomem *addr) 22 + unsigned int ioread16(const void __iomem *addr) 23 23 { 24 24 return readw(addr); 25 25 } 26 - unsigned int ioread16be(void __iomem *addr) 26 + unsigned int ioread16be(const void __iomem *addr) 27 27 { 28 28 return readw_be(addr); 29 29 } 30 - unsigned int ioread32(void __iomem *addr) 30 + unsigned int ioread32(const void __iomem *addr) 31 31 { 32 32 return readl(addr); 33 33 } 34 - unsigned int ioread32be(void __iomem *addr) 34 + unsigned int ioread32be(const void __iomem *addr) 35 35 { 36 36 return readl_be(addr); 37 37 } ··· 41 41 EXPORT_SYMBOL(ioread32); 42 42 EXPORT_SYMBOL(ioread32be); 43 43 #ifdef __powerpc64__ 44 - u64 ioread64(void __iomem *addr) 44 + u64 ioread64(const void __iomem *addr) 45 45 { 46 46 return readq(addr); 47 47 } 48 - u64 ioread64_lo_hi(void __iomem *addr) 48 + u64 ioread64_lo_hi(const void __iomem *addr) 49 49 { 50 50 return readq(addr); 51 51 } 52 - u64 ioread64_hi_lo(void __iomem *addr) 52 + u64 ioread64_hi_lo(const void __iomem *addr) 53 53 { 54 54 return readq(addr); 55 55 } 56 - u64 ioread64be(void __iomem *addr) 56 + u64 ioread64be(const void __iomem *addr) 57 57 { 58 58 return readq_be(addr); 59 59 } 60 - u64 ioread64be_lo_hi(void __iomem *addr) 60 + u64 ioread64be_lo_hi(const void __iomem *addr) 61 61 { 62 62 return readq_be(addr); 63 63 } 64 - u64 ioread64be_hi_lo(void __iomem *addr) 64 + u64 ioread64be_hi_lo(const void __iomem *addr) 65 65 { 66 66 return readq_be(addr); 67 67 } ··· 139 139 * FIXME! We could make these do EEH handling if we really 140 140 * wanted. Not clear if we do. 141 141 */ 142 - void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) 142 + void ioread8_rep(const void __iomem *addr, void *dst, unsigned long count) 143 143 { 144 144 readsb(addr, dst, count); 145 145 } 146 - void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) 146 + void ioread16_rep(const void __iomem *addr, void *dst, unsigned long count) 147 147 { 148 148 readsw(addr, dst, count); 149 149 } 150 - void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) 150 + void ioread32_rep(const void __iomem *addr, void *dst, unsigned long count) 151 151 { 152 152 readsl(addr, dst, count); 153 153 }
+1 -1
arch/powerpc/kernel/syscalls/syscall.tbl
··· 197 197 146 common writev sys_writev compat_sys_writev 198 198 147 common getsid sys_getsid 199 199 148 common fdatasync sys_fdatasync 200 - 149 nospu _sysctl sys_sysctl compat_sys_sysctl 200 + 149 nospu _sysctl sys_ni_syscall 201 201 150 common mlock sys_mlock 202 202 151 common munlock sys_munlock 203 203 152 common mlockall sys_mlockall
+1 -1
arch/s390/kernel/syscalls/syscall.tbl
··· 138 138 146 common writev sys_writev compat_sys_writev 139 139 147 common getsid sys_getsid sys_getsid 140 140 148 common fdatasync sys_fdatasync sys_fdatasync 141 - 149 common _sysctl sys_sysctl compat_sys_sysctl 141 + 149 common _sysctl - - 142 142 150 common mlock sys_mlock sys_mlock 143 143 151 common munlock sys_munlock sys_munlock 144 144 152 common mlockall sys_mlockall sys_mlockall
-1
arch/sh/configs/dreamcast_defconfig
··· 1 1 CONFIG_SYSVIPC=y 2 2 CONFIG_BSD_PROCESS_ACCT=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - # CONFIG_SYSCTL_SYSCALL is not set 5 4 CONFIG_SLAB=y 6 5 CONFIG_PROFILING=y 7 6 CONFIG_MODULES=y
-1
arch/sh/configs/espt_defconfig
··· 5 5 CONFIG_NAMESPACES=y 6 6 CONFIG_UTS_NS=y 7 7 CONFIG_IPC_NS=y 8 - # CONFIG_SYSCTL_SYSCALL is not set 9 8 CONFIG_SLAB=y 10 9 CONFIG_PROFILING=y 11 10 CONFIG_OPROFILE=y
-1
arch/sh/configs/hp6xx_defconfig
··· 3 3 CONFIG_IKCONFIG_PROC=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - # CONFIG_SYSCTL_SYSCALL is not set 7 6 CONFIG_SLAB=y 8 7 # CONFIG_BLK_DEV_BSG is not set 9 8 CONFIG_CPU_SUBTYPE_SH7709=y
-1
arch/sh/configs/landisk_defconfig
··· 1 1 CONFIG_SYSVIPC=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 - # CONFIG_SYSCTL_SYSCALL is not set 4 3 CONFIG_KALLSYMS_EXTRA_PASS=y 5 4 CONFIG_SLAB=y 6 5 CONFIG_MODULES=y
-1
arch/sh/configs/lboxre2_defconfig
··· 1 1 CONFIG_SYSVIPC=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 - # CONFIG_SYSCTL_SYSCALL is not set 4 3 CONFIG_KALLSYMS_EXTRA_PASS=y 5 4 CONFIG_SLAB=y 6 5 CONFIG_MODULES=y
-1
arch/sh/configs/microdev_defconfig
··· 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 CONFIG_BLK_DEV_INITRD=y 4 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5 - # CONFIG_SYSCTL_SYSCALL is not set 6 5 CONFIG_SLAB=y 7 6 # CONFIG_BLK_DEV_BSG is not set 8 7 CONFIG_CPU_SUBTYPE_SH4_202=y
-1
arch/sh/configs/migor_defconfig
··· 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - # CONFIG_SYSCTL_SYSCALL is not set 8 7 CONFIG_SLAB=y 9 8 CONFIG_PROFILING=y 10 9 CONFIG_OPROFILE=y
-1
arch/sh/configs/r7780mp_defconfig
··· 3 3 CONFIG_IKCONFIG=y 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - # CONFIG_SYSCTL_SYSCALL is not set 7 6 # CONFIG_FUTEX is not set 8 7 # CONFIG_EPOLL is not set 9 8 CONFIG_SLAB=y
-1
arch/sh/configs/r7785rp_defconfig
··· 7 7 CONFIG_IKCONFIG=y 8 8 CONFIG_IKCONFIG_PROC=y 9 9 CONFIG_LOG_BUF_SHIFT=14 10 - # CONFIG_SYSCTL_SYSCALL is not set 11 10 CONFIG_SLAB=y 12 11 CONFIG_PROFILING=y 13 12 CONFIG_OPROFILE=y
-1
arch/sh/configs/rts7751r2d1_defconfig
··· 1 1 CONFIG_SYSVIPC=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 4 - # CONFIG_SYSCTL_SYSCALL is not set 5 4 CONFIG_SLAB=y 6 5 CONFIG_PROFILING=y 7 6 CONFIG_OPROFILE=y
-1
arch/sh/configs/rts7751r2dplus_defconfig
··· 1 1 CONFIG_SYSVIPC=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 4 - # CONFIG_SYSCTL_SYSCALL is not set 5 4 CONFIG_SLAB=y 6 5 CONFIG_PROFILING=y 7 6 CONFIG_OPROFILE=y
-1
arch/sh/configs/se7206_defconfig
··· 18 18 CONFIG_PID_NS=y 19 19 CONFIG_BLK_DEV_INITRD=y 20 20 # CONFIG_UID16 is not set 21 - # CONFIG_SYSCTL_SYSCALL is not set 22 21 CONFIG_KALLSYMS_ALL=y 23 22 # CONFIG_ELF_CORE is not set 24 23 # CONFIG_COMPAT_BRK is not set
-1
arch/sh/configs/se7343_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 - # CONFIG_SYSCTL_SYSCALL is not set 6 5 # CONFIG_FUTEX is not set 7 6 # CONFIG_EPOLL is not set 8 7 # CONFIG_SHMEM is not set
-1
arch/sh/configs/se7619_defconfig
··· 1 1 # CONFIG_LOCALVERSION_AUTO is not set 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_UID16 is not set 4 - # CONFIG_SYSCTL_SYSCALL is not set 5 4 # CONFIG_KALLSYMS is not set 6 5 # CONFIG_HOTPLUG is not set 7 6 # CONFIG_ELF_CORE is not set
-1
arch/sh/configs/se7705_defconfig
··· 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 CONFIG_BLK_DEV_INITRD=y 4 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 5 - # CONFIG_SYSCTL_SYSCALL is not set 6 5 # CONFIG_KALLSYMS is not set 7 6 # CONFIG_HOTPLUG is not set 8 7 CONFIG_SLAB=y
-1
arch/sh/configs/se7750_defconfig
··· 5 5 CONFIG_IKCONFIG_PROC=y 6 6 CONFIG_LOG_BUF_SHIFT=14 7 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 - # CONFIG_SYSCTL_SYSCALL is not set 9 8 # CONFIG_HOTPLUG is not set 10 9 CONFIG_SLAB=y 11 10 CONFIG_MODULES=y
-1
arch/sh/configs/se7751_defconfig
··· 3 3 CONFIG_LOG_BUF_SHIFT=14 4 4 CONFIG_BLK_DEV_INITRD=y 5 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 - # CONFIG_SYSCTL_SYSCALL is not set 7 6 # CONFIG_HOTPLUG is not set 8 7 CONFIG_SLAB=y 9 8 CONFIG_MODULES=y
-1
arch/sh/configs/secureedge5410_defconfig
··· 1 1 # CONFIG_SWAP is not set 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 CONFIG_BLK_DEV_INITRD=y 4 - # CONFIG_SYSCTL_SYSCALL is not set 5 4 # CONFIG_HOTPLUG is not set 6 5 CONFIG_SLAB=y 7 6 # CONFIG_BLK_DEV_BSG is not set
-1
arch/sh/configs/sh03_defconfig
··· 3 3 CONFIG_BSD_PROCESS_ACCT=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 5 CONFIG_BLK_DEV_INITRD=y 6 - # CONFIG_SYSCTL_SYSCALL is not set 7 6 CONFIG_SLAB=y 8 7 CONFIG_PROFILING=y 9 8 CONFIG_OPROFILE=m
-1
arch/sh/configs/sh7710voipgw_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 - # CONFIG_SYSCTL_SYSCALL is not set 6 5 # CONFIG_FUTEX is not set 7 6 # CONFIG_EPOLL is not set 8 7 # CONFIG_SHMEM is not set
-1
arch/sh/configs/sh7757lcr_defconfig
··· 8 8 CONFIG_TASK_IO_ACCOUNTING=y 9 9 CONFIG_LOG_BUF_SHIFT=14 10 10 CONFIG_BLK_DEV_INITRD=y 11 - # CONFIG_SYSCTL_SYSCALL is not set 12 11 CONFIG_KALLSYMS_ALL=y 13 12 CONFIG_SLAB=y 14 13 CONFIG_MODULES=y
-1
arch/sh/configs/sh7763rdp_defconfig
··· 5 5 CONFIG_NAMESPACES=y 6 6 CONFIG_UTS_NS=y 7 7 CONFIG_IPC_NS=y 8 - # CONFIG_SYSCTL_SYSCALL is not set 9 8 CONFIG_SLAB=y 10 9 CONFIG_PROFILING=y 11 10 CONFIG_OPROFILE=y
-1
arch/sh/configs/shmin_defconfig
··· 1 1 # CONFIG_SWAP is not set 2 2 CONFIG_LOG_BUF_SHIFT=14 3 3 # CONFIG_UID16 is not set 4 - # CONFIG_SYSCTL_SYSCALL is not set 5 4 # CONFIG_KALLSYMS is not set 6 5 # CONFIG_HOTPLUG is not set 7 6 # CONFIG_BUG is not set
-1
arch/sh/configs/titan_defconfig
··· 6 6 CONFIG_LOG_BUF_SHIFT=16 7 7 CONFIG_BLK_DEV_INITRD=y 8 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 - # CONFIG_SYSCTL_SYSCALL is not set 10 9 CONFIG_SLAB=y 11 10 CONFIG_MODULES=y 12 11 CONFIG_MODULE_UNLOAD=y
-26
arch/sh/include/asm/string_32.h
··· 28 28 return __xdest; 29 29 } 30 30 31 - #define __HAVE_ARCH_STRNCPY 32 - static inline char *strncpy(char *__dest, const char *__src, size_t __n) 33 - { 34 - register char *__xdest = __dest; 35 - unsigned long __dummy; 36 - 37 - if (__n == 0) 38 - return __xdest; 39 - 40 - __asm__ __volatile__( 41 - "1:\n" 42 - "mov.b @%1+, %2\n\t" 43 - "mov.b %2, @%0\n\t" 44 - "cmp/eq #0, %2\n\t" 45 - "bt/s 2f\n\t" 46 - " cmp/eq %5,%1\n\t" 47 - "bf/s 1b\n\t" 48 - " add #1, %0\n" 49 - "2:" 50 - : "=r" (__dest), "=r" (__src), "=&z" (__dummy) 51 - : "0" (__dest), "1" (__src), "r" (__src+__n) 52 - : "memory", "t"); 53 - 54 - return __xdest; 55 - } 56 - 57 31 #define __HAVE_ARCH_STRCMP 58 32 static inline int strcmp(const char *__cs, const char *__ct) 59 33 {
+11 -11
arch/sh/kernel/iomap.c
··· 8 8 #include <linux/module.h> 9 9 #include <linux/io.h> 10 10 11 - unsigned int ioread8(void __iomem *addr) 11 + unsigned int ioread8(const void __iomem *addr) 12 12 { 13 13 return readb(addr); 14 14 } 15 15 EXPORT_SYMBOL(ioread8); 16 16 17 - unsigned int ioread16(void __iomem *addr) 17 + unsigned int ioread16(const void __iomem *addr) 18 18 { 19 19 return readw(addr); 20 20 } 21 21 EXPORT_SYMBOL(ioread16); 22 22 23 - unsigned int ioread16be(void __iomem *addr) 23 + unsigned int ioread16be(const void __iomem *addr) 24 24 { 25 25 return be16_to_cpu(__raw_readw(addr)); 26 26 } 27 27 EXPORT_SYMBOL(ioread16be); 28 28 29 - unsigned int ioread32(void __iomem *addr) 29 + unsigned int ioread32(const void __iomem *addr) 30 30 { 31 31 return readl(addr); 32 32 } 33 33 EXPORT_SYMBOL(ioread32); 34 34 35 - unsigned int ioread32be(void __iomem *addr) 35 + unsigned int ioread32be(const void __iomem *addr) 36 36 { 37 37 return be32_to_cpu(__raw_readl(addr)); 38 38 } ··· 74 74 * convert to CPU byte order. We write in "IO byte 75 75 * order" (we also don't have IO barriers). 76 76 */ 77 - static inline void mmio_insb(void __iomem *addr, u8 *dst, int count) 77 + static inline void mmio_insb(const void __iomem *addr, u8 *dst, int count) 78 78 { 79 79 while (--count >= 0) { 80 80 u8 data = __raw_readb(addr); ··· 83 83 } 84 84 } 85 85 86 - static inline void mmio_insw(void __iomem *addr, u16 *dst, int count) 86 + static inline void mmio_insw(const void __iomem *addr, u16 *dst, int count) 87 87 { 88 88 while (--count >= 0) { 89 89 u16 data = __raw_readw(addr); ··· 92 92 } 93 93 } 94 94 95 - static inline void mmio_insl(void __iomem *addr, u32 *dst, int count) 95 + static inline void mmio_insl(const void __iomem *addr, u32 *dst, int count) 96 96 { 97 97 while (--count >= 0) { 98 98 u32 data = __raw_readl(addr); ··· 125 125 } 126 126 } 127 127 128 - void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) 128 + void ioread8_rep(const void __iomem *addr, void *dst, unsigned long count) 129 129 { 130 130 mmio_insb(addr, dst, count); 131 131 } 132 132 EXPORT_SYMBOL(ioread8_rep); 133 133 134 - void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) 134 + void ioread16_rep(const void __iomem *addr, void *dst, unsigned long count) 135 135 { 136 136 mmio_insw(addr, dst, count); 137 137 } 138 138 EXPORT_SYMBOL(ioread16_rep); 139 139 140 - void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) 140 + void ioread32_rep(const void __iomem *addr, void *dst, unsigned long count) 141 141 { 142 142 mmio_insl(addr, dst, count); 143 143 }
+1 -1
arch/sh/kernel/syscalls/syscall.tbl
··· 156 156 146 common writev sys_writev 157 157 147 common getsid sys_getsid 158 158 148 common fdatasync sys_fdatasync 159 - 149 common _sysctl sys_sysctl 159 + 149 common _sysctl sys_ni_syscall 160 160 150 common mlock sys_mlock 161 161 151 common munlock sys_munlock 162 162 152 common mlockall sys_mlockall
+1 -1
arch/sparc/kernel/syscalls/syscall.tbl
··· 300 300 249 64 nanosleep sys_nanosleep 301 301 250 32 mremap sys_mremap 302 302 250 64 mremap sys_64_mremap 303 - 251 common _sysctl sys_sysctl compat_sys_sysctl 303 + 251 common _sysctl sys_ni_syscall 304 304 252 common getsid sys_getsid 305 305 253 common fdatasync sys_fdatasync 306 306 254 32 nfsservctl sys_ni_syscall sys_nis_syscall
+1 -1
arch/x86/entry/syscalls/syscall_32.tbl
··· 160 160 146 i386 writev sys_writev compat_sys_writev 161 161 147 i386 getsid sys_getsid 162 162 148 i386 fdatasync sys_fdatasync 163 - 149 i386 _sysctl sys_sysctl compat_sys_sysctl 163 + 149 i386 _sysctl sys_ni_syscall 164 164 150 i386 mlock sys_mlock 165 165 151 i386 munlock sys_munlock 166 166 152 i386 mlockall sys_mlockall
+1 -1
arch/x86/entry/syscalls/syscall_64.tbl
··· 164 164 153 common vhangup sys_vhangup 165 165 154 common modify_ldt sys_modify_ldt 166 166 155 common pivot_root sys_pivot_root 167 - 156 64 _sysctl sys_sysctl 167 + 156 64 _sysctl sys_ni_syscall 168 168 157 common prctl sys_prctl 169 169 158 common arch_prctl sys_arch_prctl 170 170 159 common adjtimex sys_adjtimex
+1 -1
arch/xtensa/kernel/syscalls/syscall.tbl
··· 222 222 204 common quotactl sys_quotactl 223 223 # 205 was old nfsservctl 224 224 205 common nfsservctl sys_ni_syscall 225 - 206 common _sysctl sys_sysctl 225 + 206 common _sysctl sys_ni_syscall 226 226 207 common bdflush sys_bdflush 227 227 208 common uname sys_newuname 228 228 209 common sysinfo sys_sysinfo
+1 -1
drivers/mailbox/bcm-pdc-mailbox.c
··· 679 679 680 680 /* read last_rx_curr from register once */ 681 681 pdcs->last_rx_curr = 682 - (ioread32(&pdcs->rxregs_64->status0) & 682 + (ioread32((const void __iomem *)&pdcs->rxregs_64->status0) & 683 683 CRYPTO_D64_RS0_CD_MASK) / RING_ENTRY_SIZE; 684 684 685 685 do {
+3 -3
drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8180.h
··· 150 150 void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam); 151 151 void rtl8180_set_anaparam2(struct rtl8180_priv *priv, u32 anaparam2); 152 152 153 - static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr) 153 + static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, const u8 __iomem *addr) 154 154 { 155 155 return ioread8(addr); 156 156 } 157 157 158 - static inline u16 rtl818x_ioread16(struct rtl8180_priv *priv, __le16 __iomem *addr) 158 + static inline u16 rtl818x_ioread16(struct rtl8180_priv *priv, const __le16 __iomem *addr) 159 159 { 160 160 return ioread16(addr); 161 161 } 162 162 163 - static inline u32 rtl818x_ioread32(struct rtl8180_priv *priv, __le32 __iomem *addr) 163 + static inline u32 rtl818x_ioread32(struct rtl8180_priv *priv, const __le32 __iomem *addr) 164 164 { 165 165 return ioread32(addr); 166 166 }
+1 -1
drivers/ntb/hw/intel/ntb_hw_gen1.c
··· 1205 1205 ndev->peer_reg->spad); 1206 1206 } 1207 1207 1208 - static u64 xeon_db_ioread(void __iomem *mmio) 1208 + static u64 xeon_db_ioread(const void __iomem *mmio) 1209 1209 { 1210 1210 return (u64)ioread16(mmio); 1211 1211 }
+1 -1
drivers/ntb/hw/intel/ntb_hw_gen3.h
··· 91 91 #define GEN3_DB_TOTAL_SHIFT 33 92 92 #define GEN3_SPAD_COUNT 16 93 93 94 - static inline u64 gen3_db_ioread(void __iomem *mmio) 94 + static inline u64 gen3_db_ioread(const void __iomem *mmio) 95 95 { 96 96 return ioread64(mmio); 97 97 }
+1 -1
drivers/ntb/hw/intel/ntb_hw_intel.h
··· 103 103 struct intel_ntb_reg { 104 104 int (*poll_link)(struct intel_ntb_dev *ndev); 105 105 int (*link_is_up)(struct intel_ntb_dev *ndev); 106 - u64 (*db_ioread)(void __iomem *mmio); 106 + u64 (*db_ioread)(const void __iomem *mmio); 107 107 void (*db_iowrite)(u64 db_bits, void __iomem *mmio); 108 108 unsigned long ntb_ctl; 109 109 resource_size_t db_size;
+1 -3
drivers/nvdimm/btt.c
··· 1490 1490 { 1491 1491 struct btt *btt = bdev->bd_disk->private_data; 1492 1492 int rc; 1493 - unsigned int len; 1494 1493 1495 - len = hpage_nr_pages(page) * PAGE_SIZE; 1496 - rc = btt_do_bvec(btt, NULL, page, len, 0, op, sector); 1494 + rc = btt_do_bvec(btt, NULL, page, thp_size(page), 0, op, sector); 1497 1495 if (rc == 0) 1498 1496 page_endio(page, op_is_write(op), 0); 1499 1497
+2 -4
drivers/nvdimm/pmem.c
··· 238 238 blk_status_t rc; 239 239 240 240 if (op_is_write(op)) 241 - rc = pmem_do_write(pmem, page, 0, sector, 242 - hpage_nr_pages(page) * PAGE_SIZE); 241 + rc = pmem_do_write(pmem, page, 0, sector, thp_size(page)); 243 242 else 244 - rc = pmem_do_read(pmem, page, 0, sector, 245 - hpage_nr_pages(page) * PAGE_SIZE); 243 + rc = pmem_do_read(pmem, page, 0, sector, thp_size(page)); 246 244 /* 247 245 * The ->rw_page interface is subtle and tricky. The core 248 246 * retries on any error, so we can only invoke page_endio() in
+3 -18
drivers/sh/clk/cpg.c
··· 36 36 iowrite32(value, clk->mapped_reg); 37 37 } 38 38 39 - static unsigned int r8(const void __iomem *addr) 40 - { 41 - return ioread8(addr); 42 - } 43 - 44 - static unsigned int r16(const void __iomem *addr) 45 - { 46 - return ioread16(addr); 47 - } 48 - 49 - static unsigned int r32(const void __iomem *addr) 50 - { 51 - return ioread32(addr); 52 - } 53 - 54 39 static int sh_clk_mstp_enable(struct clk *clk) 55 40 { 56 41 sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk); ··· 46 61 (phys_addr_t)clk->enable_reg + clk->mapped_reg; 47 62 48 63 if (clk->flags & CLK_ENABLE_REG_8BIT) 49 - read = r8; 64 + read = ioread8; 50 65 else if (clk->flags & CLK_ENABLE_REG_16BIT) 51 - read = r16; 66 + read = ioread16; 52 67 else 53 - read = r32; 68 + read = ioread32; 54 69 55 70 for (i = 1000; 56 71 (read(mapped_status) & (1 << clk->enable_bit)) && i;
+3 -3
drivers/virtio/virtio_pci_modern.c
··· 27 27 * method, i.e. 32-bit accesses for 32-bit fields, 16-bit accesses 28 28 * for 16-bit fields and 8-bit accesses for 8-bit fields. 29 29 */ 30 - static inline u8 vp_ioread8(u8 __iomem *addr) 30 + static inline u8 vp_ioread8(const u8 __iomem *addr) 31 31 { 32 32 return ioread8(addr); 33 33 } 34 - static inline u16 vp_ioread16 (__le16 __iomem *addr) 34 + static inline u16 vp_ioread16 (const __le16 __iomem *addr) 35 35 { 36 36 return ioread16(addr); 37 37 } 38 38 39 - static inline u32 vp_ioread32(__le32 __iomem *addr) 39 + static inline u32 vp_ioread32(const __le32 __iomem *addr) 40 40 { 41 41 return ioread32(addr); 42 42 }
+2 -2
fs/autofs/dev-ioctl.c
··· 20 20 * another mount. This situation arises when starting automount(8) 21 21 * or other user space daemon which uses direct mounts or offset 22 22 * mounts (used for autofs lazy mount/umount of nested mount trees), 23 - * which have been left busy at at service shutdown. 23 + * which have been left busy at service shutdown. 24 24 */ 25 25 26 26 typedef int (*ioctl_fn)(struct file *, struct autofs_sb_info *, ··· 496 496 * located path is the root of a mount we return 1 along with 497 497 * the super magic of the mount or 0 otherwise. 498 498 * 499 - * In both cases the the device number (as returned by 499 + * In both cases the device number (as returned by 500 500 * new_encode_dev()) is also returned. 501 501 */ 502 502 static int autofs_dev_ioctl_ismountpoint(struct file *fp,
+3 -1
fs/namei.c
··· 2849 2849 case S_IFLNK: 2850 2850 return -ELOOP; 2851 2851 case S_IFDIR: 2852 - if (acc_mode & (MAY_WRITE | MAY_EXEC)) 2852 + if (acc_mode & MAY_WRITE) 2853 2853 return -EISDIR; 2854 + if (acc_mode & MAY_EXEC) 2855 + return -EACCES; 2854 2856 break; 2855 2857 case S_IFBLK: 2856 2858 case S_IFCHR:
+14 -14
include/asm-generic/iomap.h
··· 26 26 * in the low address range. Architectures for which this is not 27 27 * true can't use this generic implementation. 28 28 */ 29 - extern unsigned int ioread8(void __iomem *); 30 - extern unsigned int ioread16(void __iomem *); 31 - extern unsigned int ioread16be(void __iomem *); 32 - extern unsigned int ioread32(void __iomem *); 33 - extern unsigned int ioread32be(void __iomem *); 29 + extern unsigned int ioread8(const void __iomem *); 30 + extern unsigned int ioread16(const void __iomem *); 31 + extern unsigned int ioread16be(const void __iomem *); 32 + extern unsigned int ioread32(const void __iomem *); 33 + extern unsigned int ioread32be(const void __iomem *); 34 34 #ifdef CONFIG_64BIT 35 - extern u64 ioread64(void __iomem *); 36 - extern u64 ioread64be(void __iomem *); 35 + extern u64 ioread64(const void __iomem *); 36 + extern u64 ioread64be(const void __iomem *); 37 37 #endif 38 38 39 39 #ifdef readq ··· 41 41 #define ioread64_hi_lo ioread64_hi_lo 42 42 #define ioread64be_lo_hi ioread64be_lo_hi 43 43 #define ioread64be_hi_lo ioread64be_hi_lo 44 - extern u64 ioread64_lo_hi(void __iomem *addr); 45 - extern u64 ioread64_hi_lo(void __iomem *addr); 46 - extern u64 ioread64be_lo_hi(void __iomem *addr); 47 - extern u64 ioread64be_hi_lo(void __iomem *addr); 44 + extern u64 ioread64_lo_hi(const void __iomem *addr); 45 + extern u64 ioread64_hi_lo(const void __iomem *addr); 46 + extern u64 ioread64be_lo_hi(const void __iomem *addr); 47 + extern u64 ioread64be_hi_lo(const void __iomem *addr); 48 48 #endif 49 49 50 50 extern void iowrite8(u8, void __iomem *); ··· 79 79 * memory across multiple ports, use "memcpy_toio()" 80 80 * and friends. 81 81 */ 82 - extern void ioread8_rep(void __iomem *port, void *buf, unsigned long count); 83 - extern void ioread16_rep(void __iomem *port, void *buf, unsigned long count); 84 - extern void ioread32_rep(void __iomem *port, void *buf, unsigned long count); 82 + extern void ioread8_rep(const void __iomem *port, void *buf, unsigned long count); 83 + extern void ioread16_rep(const void __iomem *port, void *buf, unsigned long count); 84 + extern void ioread32_rep(const void __iomem *port, void *buf, unsigned long count); 85 85 86 86 extern void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count); 87 87 extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count);
+1 -1
include/asm-generic/pgalloc.h
··· 147 147 148 148 #if CONFIG_PGTABLE_LEVELS > 3 149 149 150 - #ifndef __HAVE_ARCH_PUD_FREE 150 + #ifndef __HAVE_ARCH_PUD_ALLOC_ONE 151 151 /** 152 152 * pud_alloc_one - allocate a page for PUD-level page table 153 153 * @mm: the mm_struct of the current context
+1
include/asm-generic/vmlinux.lds.h
··· 394 394 */ 395 395 #ifndef RO_AFTER_INIT_DATA 396 396 #define RO_AFTER_INIT_DATA \ 397 + . = ALIGN(8); \ 397 398 __start_ro_after_init = .; \ 398 399 *(.data..ro_after_init) \ 399 400 JUMP_TABLE_DATA \
-1
include/linux/compat.h
··· 851 851 asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32); 852 852 asmlinkage long compat_sys_recv(int fd, void __user *buf, compat_size_t len, 853 853 unsigned flags); 854 - asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args); 855 854 856 855 /* obsolete: fs/readdir.c */ 857 856 asmlinkage long compat_sys_old_readdir(unsigned int fd,
+54 -4
include/linux/huge_mm.h
··· 258 258 else 259 259 return NULL; 260 260 } 261 - static inline int hpage_nr_pages(struct page *page) 261 + 262 + /** 263 + * thp_head - Head page of a transparent huge page. 264 + * @page: Any page (tail, head or regular) found in the page cache. 265 + */ 266 + static inline struct page *thp_head(struct page *page) 262 267 { 263 - if (unlikely(PageTransHuge(page))) 268 + return compound_head(page); 269 + } 270 + 271 + /** 272 + * thp_order - Order of a transparent huge page. 273 + * @page: Head page of a transparent huge page. 274 + */ 275 + static inline unsigned int thp_order(struct page *page) 276 + { 277 + VM_BUG_ON_PGFLAGS(PageTail(page), page); 278 + if (PageHead(page)) 279 + return HPAGE_PMD_ORDER; 280 + return 0; 281 + } 282 + 283 + /** 284 + * thp_nr_pages - The number of regular pages in this huge page. 285 + * @page: The head page of a huge page. 286 + */ 287 + static inline int thp_nr_pages(struct page *page) 288 + { 289 + VM_BUG_ON_PGFLAGS(PageTail(page), page); 290 + if (PageHead(page)) 264 291 return HPAGE_PMD_NR; 265 292 return 1; 266 293 } ··· 344 317 #define HPAGE_PUD_MASK ({ BUILD_BUG(); 0; }) 345 318 #define HPAGE_PUD_SIZE ({ BUILD_BUG(); 0; }) 346 319 347 - static inline int hpage_nr_pages(struct page *page) 320 + static inline struct page *thp_head(struct page *page) 348 321 { 349 - VM_BUG_ON_PAGE(PageTail(page), page); 322 + VM_BUG_ON_PGFLAGS(PageTail(page), page); 323 + return page; 324 + } 325 + 326 + static inline unsigned int thp_order(struct page *page) 327 + { 328 + VM_BUG_ON_PGFLAGS(PageTail(page), page); 329 + return 0; 330 + } 331 + 332 + static inline int thp_nr_pages(struct page *page) 333 + { 334 + VM_BUG_ON_PGFLAGS(PageTail(page), page); 350 335 return 1; 351 336 } 352 337 ··· 481 442 return false; 482 443 } 483 444 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 445 + 446 + /** 447 + * thp_size - Size of a transparent huge page. 448 + * @page: Head page of a transparent huge page. 449 + * 450 + * Return: Number of bytes in this page. 451 + */ 452 + static inline unsigned long thp_size(struct page *page) 453 + { 454 + return PAGE_SIZE << thp_order(page); 455 + } 484 456 485 457 #endif /* _LINUX_HUGE_MM_H */
+2 -2
include/linux/io-64-nonatomic-hi-lo.h
··· 57 57 58 58 #ifndef ioread64_hi_lo 59 59 #define ioread64_hi_lo ioread64_hi_lo 60 - static inline u64 ioread64_hi_lo(void __iomem *addr) 60 + static inline u64 ioread64_hi_lo(const void __iomem *addr) 61 61 { 62 62 u32 low, high; 63 63 ··· 79 79 80 80 #ifndef ioread64be_hi_lo 81 81 #define ioread64be_hi_lo ioread64be_hi_lo 82 - static inline u64 ioread64be_hi_lo(void __iomem *addr) 82 + static inline u64 ioread64be_hi_lo(const void __iomem *addr) 83 83 { 84 84 u32 low, high; 85 85
+2 -2
include/linux/io-64-nonatomic-lo-hi.h
··· 57 57 58 58 #ifndef ioread64_lo_hi 59 59 #define ioread64_lo_hi ioread64_lo_hi 60 - static inline u64 ioread64_lo_hi(void __iomem *addr) 60 + static inline u64 ioread64_lo_hi(const void __iomem *addr) 61 61 { 62 62 u32 low, high; 63 63 ··· 79 79 80 80 #ifndef ioread64be_lo_hi 81 81 #define ioread64be_lo_hi ioread64be_lo_hi 82 - static inline u64 ioread64be_lo_hi(void __iomem *addr) 82 + static inline u64 ioread64be_lo_hi(const void __iomem *addr) 83 83 { 84 84 u32 low, high; 85 85
+1 -1
include/linux/memcontrol.h
··· 630 630 struct mem_cgroup_per_node *mz; 631 631 632 632 mz = container_of(lruvec, struct mem_cgroup_per_node, lruvec); 633 - return mz->lru_zone_size[zone_idx][lru]; 633 + return READ_ONCE(mz->lru_zone_size[zone_idx][lru]); 634 634 } 635 635 636 636 void mem_cgroup_handle_over_high(void);
+7 -6
include/linux/mm.h
··· 24 24 #include <linux/resource.h> 25 25 #include <linux/page_ext.h> 26 26 #include <linux/err.h> 27 + #include <linux/page-flags.h> 27 28 #include <linux/page_ref.h> 28 29 #include <linux/memremap.h> 29 30 #include <linux/overflow.h> ··· 669 668 struct mmu_gather; 670 669 struct inode; 671 670 672 - /* 673 - * FIXME: take this include out, include page-flags.h in 674 - * files which need it (119 of them) 675 - */ 676 - #include <linux/page-flags.h> 677 671 #include <linux/huge_mm.h> 678 672 679 673 /* ··· 918 922 static inline void set_compound_order(struct page *page, unsigned int order) 919 923 { 920 924 page[1].compound_order = order; 925 + page[1].compound_nr = 1U << order; 921 926 } 922 927 923 928 /* Returns the number of pages in this potentially compound page. */ 924 929 static inline unsigned long compound_nr(struct page *page) 925 930 { 926 - return 1UL << compound_order(page); 931 + if (!PageHead(page)) 932 + return 1; 933 + return page[1].compound_nr; 927 934 } 928 935 929 936 /* Returns the number of bytes in this potentially compound page. */ ··· 1067 1068 1068 1069 static inline enum zone_type page_zonenum(const struct page *page) 1069 1070 { 1071 + ASSERT_EXCLUSIVE_BITS(page->flags, ZONES_MASK << ZONES_PGSHIFT); 1070 1072 return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; 1071 1073 } 1072 1074 ··· 1595 1595 extern void pagefault_out_of_memory(void); 1596 1596 1597 1597 #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) 1598 + #define offset_in_thp(page, p) ((unsigned long)(p) & (thp_size(page) - 1)) 1598 1599 1599 1600 /* 1600 1601 * Flags passed to show_mem() and show_free_areas() to suppress output in
+3 -3
include/linux/mm_inline.h
··· 48 48 static __always_inline void add_page_to_lru_list(struct page *page, 49 49 struct lruvec *lruvec, enum lru_list lru) 50 50 { 51 - update_lru_size(lruvec, lru, page_zonenum(page), hpage_nr_pages(page)); 51 + update_lru_size(lruvec, lru, page_zonenum(page), thp_nr_pages(page)); 52 52 list_add(&page->lru, &lruvec->lists[lru]); 53 53 } 54 54 55 55 static __always_inline void add_page_to_lru_list_tail(struct page *page, 56 56 struct lruvec *lruvec, enum lru_list lru) 57 57 { 58 - update_lru_size(lruvec, lru, page_zonenum(page), hpage_nr_pages(page)); 58 + update_lru_size(lruvec, lru, page_zonenum(page), thp_nr_pages(page)); 59 59 list_add_tail(&page->lru, &lruvec->lists[lru]); 60 60 } 61 61 ··· 63 63 struct lruvec *lruvec, enum lru_list lru) 64 64 { 65 65 list_del(&page->lru); 66 - update_lru_size(lruvec, lru, page_zonenum(page), -hpage_nr_pages(page)); 66 + update_lru_size(lruvec, lru, page_zonenum(page), -thp_nr_pages(page)); 67 67 } 68 68 69 69 /**
+1
include/linux/mm_types.h
··· 134 134 unsigned char compound_dtor; 135 135 unsigned char compound_order; 136 136 atomic_t compound_mapcount; 137 + unsigned int compound_nr; /* 1 << compound_order */ 137 138 }; 138 139 struct { /* Second tail page of compound page */ 139 140 unsigned long _compound_pad_1; /* compound_head */
+3 -3
include/linux/pagemap.h
··· 381 381 if (PageHuge(head)) 382 382 return head; 383 383 384 - return head + (index & (hpage_nr_pages(head) - 1)); 384 + return head + (index & (thp_nr_pages(head) - 1)); 385 385 } 386 386 387 387 struct page *find_get_entry(struct address_space *mapping, pgoff_t offset); ··· 773 773 774 774 page = xa_load(&rac->mapping->i_pages, rac->_index); 775 775 VM_BUG_ON_PAGE(!PageLocked(page), page); 776 - rac->_batch_count = hpage_nr_pages(page); 776 + rac->_batch_count = thp_nr_pages(page); 777 777 778 778 return page; 779 779 } ··· 796 796 VM_BUG_ON_PAGE(!PageLocked(page), page); 797 797 VM_BUG_ON_PAGE(PageTail(page), page); 798 798 array[i++] = page; 799 - rac->_batch_count += hpage_nr_pages(page); 799 + rac->_batch_count += thp_nr_pages(page); 800 800 801 801 /* 802 802 * The page cache isn't using multi-index entries yet,
-2
include/linux/syscalls.h
··· 47 47 struct statfs; 48 48 struct statfs64; 49 49 struct statx; 50 - struct __sysctl_args; 51 50 struct sysinfo; 52 51 struct timespec; 53 52 struct __kernel_old_timeval; ··· 1116 1117 asmlinkage long sys_bdflush(int func, long data); 1117 1118 asmlinkage long sys_oldumount(char __user *name); 1118 1119 asmlinkage long sys_uselib(const char __user *library); 1119 - asmlinkage long sys_sysctl(struct __sysctl_args __user *args); 1120 1120 asmlinkage long sys_sysfs(int option, 1121 1121 unsigned long arg1, unsigned long arg2); 1122 1122 asmlinkage long sys_fork(void);
+2 -4
include/linux/sysctl.h
··· 74 74 * sysctl names can be mirrored automatically under /proc/sys. The 75 75 * procname supplied controls /proc naming. 76 76 * 77 - * The table's mode will be honoured both for sys_sysctl(2) and 78 - * proc-fs access. 77 + * The table's mode will be honoured for proc-fs access. 79 78 * 80 79 * Leaf nodes in the sysctl tree will be represented by a single file 81 80 * under /proc; non-leaf nodes will be represented by directories. A 82 81 * null procname disables /proc mirroring at this node. 83 82 * 84 - * sysctl(2) can automatically manage read and write requests through 85 - * the sysctl table. The data and maxlen fields of the ctl_table 83 + * The data and maxlen fields of the ctl_table 86 84 * struct enable minimal validation of the values being written to be 87 85 * performed, and the mode field allows minimal authentication. 88 86 *
+1 -1
kernel/Makefile
··· 5 5 6 6 obj-y = fork.o exec_domain.o panic.o \ 7 7 cpu.o exit.o softirq.o resource.o \ 8 - sysctl.o sysctl_binary.o capability.o ptrace.o user.o \ 8 + sysctl.o capability.o ptrace.o user.o \ 9 9 signal.o sys.o umh.o workqueue.o pid.o task_work.o \ 10 10 extable.o params.o \ 11 11 kthread.o sys_ni.o nsproxy.o \
-1
kernel/sys_ni.c
··· 364 364 COND_SYSCALL_COMPAT(socketcall); 365 365 366 366 /* compat syscalls for arm64, x86, ... */ 367 - COND_SYSCALL_COMPAT(sysctl); 368 367 COND_SYSCALL_COMPAT(fanotify_mark); 369 368 370 369 /* x86 */
-171
kernel/sysctl_binary.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/stat.h> 3 - #include <linux/sysctl.h> 4 - #include "../fs/xfs/xfs_sysctl.h" 5 - #include <linux/sunrpc/debug.h> 6 - #include <linux/string.h> 7 - #include <linux/syscalls.h> 8 - #include <linux/namei.h> 9 - #include <linux/mount.h> 10 - #include <linux/fs.h> 11 - #include <linux/nsproxy.h> 12 - #include <linux/pid_namespace.h> 13 - #include <linux/file.h> 14 - #include <linux/ctype.h> 15 - #include <linux/netdevice.h> 16 - #include <linux/kernel.h> 17 - #include <linux/uuid.h> 18 - #include <linux/slab.h> 19 - #include <linux/compat.h> 20 - 21 - static ssize_t binary_sysctl(const int *name, int nlen, 22 - void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) 23 - { 24 - return -ENOSYS; 25 - } 26 - 27 - static void deprecated_sysctl_warning(const int *name, int nlen) 28 - { 29 - int i; 30 - 31 - /* 32 - * CTL_KERN/KERN_VERSION is used by older glibc and cannot 33 - * ever go away. 34 - */ 35 - if (nlen >= 2 && name[0] == CTL_KERN && name[1] == KERN_VERSION) 36 - return; 37 - 38 - if (printk_ratelimit()) { 39 - printk(KERN_INFO 40 - "warning: process `%s' used the deprecated sysctl " 41 - "system call with ", current->comm); 42 - for (i = 0; i < nlen; i++) 43 - printk(KERN_CONT "%d.", name[i]); 44 - printk(KERN_CONT "\n"); 45 - } 46 - return; 47 - } 48 - 49 - #define WARN_ONCE_HASH_BITS 8 50 - #define WARN_ONCE_HASH_SIZE (1<<WARN_ONCE_HASH_BITS) 51 - 52 - static DECLARE_BITMAP(warn_once_bitmap, WARN_ONCE_HASH_SIZE); 53 - 54 - #define FNV32_OFFSET 2166136261U 55 - #define FNV32_PRIME 0x01000193 56 - 57 - /* 58 - * Print each legacy sysctl (approximately) only once. 59 - * To avoid making the tables non-const use a external 60 - * hash-table instead. 61 - * Worst case hash collision: 6, but very rarely. 62 - * NOTE! We don't use the SMP-safe bit tests. We simply 63 - * don't care enough. 64 - */ 65 - static void warn_on_bintable(const int *name, int nlen) 66 - { 67 - int i; 68 - u32 hash = FNV32_OFFSET; 69 - 70 - for (i = 0; i < nlen; i++) 71 - hash = (hash ^ name[i]) * FNV32_PRIME; 72 - hash %= WARN_ONCE_HASH_SIZE; 73 - if (__test_and_set_bit(hash, warn_once_bitmap)) 74 - return; 75 - deprecated_sysctl_warning(name, nlen); 76 - } 77 - 78 - static ssize_t do_sysctl(int __user *args_name, int nlen, 79 - void __user *oldval, size_t oldlen, void __user *newval, size_t newlen) 80 - { 81 - int name[CTL_MAXNAME]; 82 - int i; 83 - 84 - /* Check args->nlen. */ 85 - if (nlen < 0 || nlen > CTL_MAXNAME) 86 - return -ENOTDIR; 87 - /* Read in the sysctl name for simplicity */ 88 - for (i = 0; i < nlen; i++) 89 - if (get_user(name[i], args_name + i)) 90 - return -EFAULT; 91 - 92 - warn_on_bintable(name, nlen); 93 - 94 - return binary_sysctl(name, nlen, oldval, oldlen, newval, newlen); 95 - } 96 - 97 - SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) 98 - { 99 - struct __sysctl_args tmp; 100 - size_t oldlen = 0; 101 - ssize_t result; 102 - 103 - if (copy_from_user(&tmp, args, sizeof(tmp))) 104 - return -EFAULT; 105 - 106 - if (tmp.oldval && !tmp.oldlenp) 107 - return -EFAULT; 108 - 109 - if (tmp.oldlenp && get_user(oldlen, tmp.oldlenp)) 110 - return -EFAULT; 111 - 112 - result = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, oldlen, 113 - tmp.newval, tmp.newlen); 114 - 115 - if (result >= 0) { 116 - oldlen = result; 117 - result = 0; 118 - } 119 - 120 - if (tmp.oldlenp && put_user(oldlen, tmp.oldlenp)) 121 - return -EFAULT; 122 - 123 - return result; 124 - } 125 - 126 - 127 - #ifdef CONFIG_COMPAT 128 - 129 - struct compat_sysctl_args { 130 - compat_uptr_t name; 131 - int nlen; 132 - compat_uptr_t oldval; 133 - compat_uptr_t oldlenp; 134 - compat_uptr_t newval; 135 - compat_size_t newlen; 136 - compat_ulong_t __unused[4]; 137 - }; 138 - 139 - COMPAT_SYSCALL_DEFINE1(sysctl, struct compat_sysctl_args __user *, args) 140 - { 141 - struct compat_sysctl_args tmp; 142 - compat_size_t __user *compat_oldlenp; 143 - size_t oldlen = 0; 144 - ssize_t result; 145 - 146 - if (copy_from_user(&tmp, args, sizeof(tmp))) 147 - return -EFAULT; 148 - 149 - if (tmp.oldval && !tmp.oldlenp) 150 - return -EFAULT; 151 - 152 - compat_oldlenp = compat_ptr(tmp.oldlenp); 153 - if (compat_oldlenp && get_user(oldlen, compat_oldlenp)) 154 - return -EFAULT; 155 - 156 - result = do_sysctl(compat_ptr(tmp.name), tmp.nlen, 157 - compat_ptr(tmp.oldval), oldlen, 158 - compat_ptr(tmp.newval), tmp.newlen); 159 - 160 - if (result >= 0) { 161 - oldlen = result; 162 - result = 0; 163 - } 164 - 165 - if (compat_oldlenp && put_user(oldlen, compat_oldlenp)) 166 - return -EFAULT; 167 - 168 - return result; 169 - } 170 - 171 - #endif /* CONFIG_COMPAT */
+15 -15
lib/iomap.c
··· 70 70 #define mmio_read64be(addr) swab64(readq(addr)) 71 71 #endif 72 72 73 - unsigned int ioread8(void __iomem *addr) 73 + unsigned int ioread8(const void __iomem *addr) 74 74 { 75 75 IO_COND(addr, return inb(port), return readb(addr)); 76 76 return 0xff; 77 77 } 78 - unsigned int ioread16(void __iomem *addr) 78 + unsigned int ioread16(const void __iomem *addr) 79 79 { 80 80 IO_COND(addr, return inw(port), return readw(addr)); 81 81 return 0xffff; 82 82 } 83 - unsigned int ioread16be(void __iomem *addr) 83 + unsigned int ioread16be(const void __iomem *addr) 84 84 { 85 85 IO_COND(addr, return pio_read16be(port), return mmio_read16be(addr)); 86 86 return 0xffff; 87 87 } 88 - unsigned int ioread32(void __iomem *addr) 88 + unsigned int ioread32(const void __iomem *addr) 89 89 { 90 90 IO_COND(addr, return inl(port), return readl(addr)); 91 91 return 0xffffffff; 92 92 } 93 - unsigned int ioread32be(void __iomem *addr) 93 + unsigned int ioread32be(const void __iomem *addr) 94 94 { 95 95 IO_COND(addr, return pio_read32be(port), return mmio_read32be(addr)); 96 96 return 0xffffffff; ··· 142 142 return lo | (hi << 32); 143 143 } 144 144 145 - u64 ioread64_lo_hi(void __iomem *addr) 145 + u64 ioread64_lo_hi(const void __iomem *addr) 146 146 { 147 147 IO_COND(addr, return pio_read64_lo_hi(port), return readq(addr)); 148 148 return 0xffffffffffffffffULL; 149 149 } 150 150 151 - u64 ioread64_hi_lo(void __iomem *addr) 151 + u64 ioread64_hi_lo(const void __iomem *addr) 152 152 { 153 153 IO_COND(addr, return pio_read64_hi_lo(port), return readq(addr)); 154 154 return 0xffffffffffffffffULL; 155 155 } 156 156 157 - u64 ioread64be_lo_hi(void __iomem *addr) 157 + u64 ioread64be_lo_hi(const void __iomem *addr) 158 158 { 159 159 IO_COND(addr, return pio_read64be_lo_hi(port), 160 160 return mmio_read64be(addr)); 161 161 return 0xffffffffffffffffULL; 162 162 } 163 163 164 - u64 ioread64be_hi_lo(void __iomem *addr) 164 + u64 ioread64be_hi_lo(const void __iomem *addr) 165 165 { 166 166 IO_COND(addr, return pio_read64be_hi_lo(port), 167 167 return mmio_read64be(addr)); ··· 275 275 * order" (we also don't have IO barriers). 276 276 */ 277 277 #ifndef mmio_insb 278 - static inline void mmio_insb(void __iomem *addr, u8 *dst, int count) 278 + static inline void mmio_insb(const void __iomem *addr, u8 *dst, int count) 279 279 { 280 280 while (--count >= 0) { 281 281 u8 data = __raw_readb(addr); ··· 283 283 dst++; 284 284 } 285 285 } 286 - static inline void mmio_insw(void __iomem *addr, u16 *dst, int count) 286 + static inline void mmio_insw(const void __iomem *addr, u16 *dst, int count) 287 287 { 288 288 while (--count >= 0) { 289 289 u16 data = __raw_readw(addr); ··· 291 291 dst++; 292 292 } 293 293 } 294 - static inline void mmio_insl(void __iomem *addr, u32 *dst, int count) 294 + static inline void mmio_insl(const void __iomem *addr, u32 *dst, int count) 295 295 { 296 296 while (--count >= 0) { 297 297 u32 data = __raw_readl(addr); ··· 325 325 } 326 326 #endif 327 327 328 - void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) 328 + void ioread8_rep(const void __iomem *addr, void *dst, unsigned long count) 329 329 { 330 330 IO_COND(addr, insb(port,dst,count), mmio_insb(addr, dst, count)); 331 331 } 332 - void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) 332 + void ioread16_rep(const void __iomem *addr, void *dst, unsigned long count) 333 333 { 334 334 IO_COND(addr, insw(port,dst,count), mmio_insw(addr, dst, count)); 335 335 } 336 - void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) 336 + void ioread32_rep(const void __iomem *addr, void *dst, unsigned long count) 337 337 { 338 338 IO_COND(addr, insl(port,dst,count), mmio_insl(addr, dst, count)); 339 339 }
+2 -2
lib/lz4/lz4_compress.c
··· 446 446 *op++ = (BYTE)(lastRun << ML_BITS); 447 447 } 448 448 449 - memcpy(op, anchor, lastRun); 449 + LZ4_memcpy(op, anchor, lastRun); 450 450 451 451 op += lastRun; 452 452 } ··· 708 708 } else { 709 709 *op++ = (BYTE)(lastRunSize<<ML_BITS); 710 710 } 711 - memcpy(op, anchor, lastRunSize); 711 + LZ4_memcpy(op, anchor, lastRunSize); 712 712 op += lastRunSize; 713 713 } 714 714
+9 -9
lib/lz4/lz4_decompress.c
··· 153 153 && likely((endOnInput ? ip < shortiend : 1) & 154 154 (op <= shortoend))) { 155 155 /* Copy the literals */ 156 - memcpy(op, ip, endOnInput ? 16 : 8); 156 + LZ4_memcpy(op, ip, endOnInput ? 16 : 8); 157 157 op += length; ip += length; 158 158 159 159 /* ··· 172 172 (offset >= 8) && 173 173 (dict == withPrefix64k || match >= lowPrefix)) { 174 174 /* Copy the match. */ 175 - memcpy(op + 0, match + 0, 8); 176 - memcpy(op + 8, match + 8, 8); 177 - memcpy(op + 16, match + 16, 2); 175 + LZ4_memcpy(op + 0, match + 0, 8); 176 + LZ4_memcpy(op + 8, match + 8, 8); 177 + LZ4_memcpy(op + 16, match + 16, 2); 178 178 op += length + MINMATCH; 179 179 /* Both stages worked, load the next token. */ 180 180 continue; ··· 263 263 } 264 264 } 265 265 266 - memcpy(op, ip, length); 266 + LZ4_memcpy(op, ip, length); 267 267 ip += length; 268 268 op += length; 269 269 ··· 350 350 size_t const copySize = (size_t)(lowPrefix - match); 351 351 size_t const restSize = length - copySize; 352 352 353 - memcpy(op, dictEnd - copySize, copySize); 353 + LZ4_memcpy(op, dictEnd - copySize, copySize); 354 354 op += copySize; 355 355 if (restSize > (size_t)(op - lowPrefix)) { 356 356 /* overlap copy */ ··· 360 360 while (op < endOfMatch) 361 361 *op++ = *copyFrom++; 362 362 } else { 363 - memcpy(op, lowPrefix, restSize); 363 + LZ4_memcpy(op, lowPrefix, restSize); 364 364 op += restSize; 365 365 } 366 366 } ··· 386 386 while (op < copyEnd) 387 387 *op++ = *match++; 388 388 } else { 389 - memcpy(op, match, mlen); 389 + LZ4_memcpy(op, match, mlen); 390 390 } 391 391 op = copyEnd; 392 392 if (op == oend) ··· 400 400 op[2] = match[2]; 401 401 op[3] = match[3]; 402 402 match += inc32table[offset]; 403 - memcpy(op + 4, match, 4); 403 + LZ4_memcpy(op + 4, match, 4); 404 404 match -= dec64table[offset]; 405 405 } else { 406 406 LZ4_copy8(op, match);
+10
lib/lz4/lz4defs.h
··· 137 137 return put_unaligned_le16(value, memPtr); 138 138 } 139 139 140 + /* 141 + * LZ4 relies on memcpy with a constant size being inlined. In freestanding 142 + * environments, the compiler can't assume the implementation of memcpy() is 143 + * standard compliant, so apply its specialized memcpy() inlining logic. When 144 + * possible, use __builtin_memcpy() to tell the compiler to analyze memcpy() 145 + * as-if it were standard compliant, so it can inline it in freestanding 146 + * environments. This is needed when decompressing the Linux Kernel, for example. 147 + */ 148 + #define LZ4_memcpy(dst, src, size) __builtin_memcpy(dst, src, size) 149 + 140 150 static FORCE_INLINE void LZ4_copy8(void *dst, const void *src) 141 151 { 142 152 #if LZ4_ARCH64
+1 -1
lib/lz4/lz4hc_compress.c
··· 570 570 *op++ = (BYTE) lastRun; 571 571 } else 572 572 *op++ = (BYTE)(lastRun<<ML_BITS); 573 - memcpy(op, anchor, iend - anchor); 573 + LZ4_memcpy(op, anchor, iend - anchor); 574 574 op += iend - anchor; 575 575 } 576 576
+1 -1
mm/compaction.c
··· 1009 1009 del_page_from_lru_list(page, lruvec, page_lru(page)); 1010 1010 mod_node_page_state(page_pgdat(page), 1011 1011 NR_ISOLATED_ANON + page_is_file_lru(page), 1012 - hpage_nr_pages(page)); 1012 + thp_nr_pages(page)); 1013 1013 1014 1014 isolate_success: 1015 1015 list_add(&page->lru, &cc->migratepages);
+14 -8
mm/filemap.c
··· 198 198 if (PageHuge(page)) 199 199 return; 200 200 201 - nr = hpage_nr_pages(page); 201 + nr = thp_nr_pages(page); 202 202 203 203 __mod_lruvec_page_state(page, NR_FILE_PAGES, -nr); 204 204 if (PageSwapBacked(page)) { ··· 2468 2468 struct address_space *mapping = file->f_mapping; 2469 2469 struct file *fpin = NULL; 2470 2470 pgoff_t offset = vmf->pgoff; 2471 + unsigned int mmap_miss; 2471 2472 2472 2473 /* If we don't want any read-ahead, don't bother */ 2473 2474 if (vmf->vma->vm_flags & VM_RAND_READ) ··· 2484 2483 } 2485 2484 2486 2485 /* Avoid banging the cache line if not needed */ 2487 - if (ra->mmap_miss < MMAP_LOTSAMISS * 10) 2488 - ra->mmap_miss++; 2486 + mmap_miss = READ_ONCE(ra->mmap_miss); 2487 + if (mmap_miss < MMAP_LOTSAMISS * 10) 2488 + WRITE_ONCE(ra->mmap_miss, ++mmap_miss); 2489 2489 2490 2490 /* 2491 2491 * Do we miss much more than hit in this file? If so, 2492 2492 * stop bothering with read-ahead. It will only hurt. 2493 2493 */ 2494 - if (ra->mmap_miss > MMAP_LOTSAMISS) 2494 + if (mmap_miss > MMAP_LOTSAMISS) 2495 2495 return fpin; 2496 2496 2497 2497 /* ··· 2518 2516 struct file_ra_state *ra = &file->f_ra; 2519 2517 struct address_space *mapping = file->f_mapping; 2520 2518 struct file *fpin = NULL; 2519 + unsigned int mmap_miss; 2521 2520 pgoff_t offset = vmf->pgoff; 2522 2521 2523 2522 /* If we don't want any read-ahead, don't bother */ 2524 2523 if (vmf->vma->vm_flags & VM_RAND_READ || !ra->ra_pages) 2525 2524 return fpin; 2526 - if (ra->mmap_miss > 0) 2527 - ra->mmap_miss--; 2525 + mmap_miss = READ_ONCE(ra->mmap_miss); 2526 + if (mmap_miss) 2527 + WRITE_ONCE(ra->mmap_miss, --mmap_miss); 2528 2528 if (PageReadahead(page)) { 2529 2529 fpin = maybe_unlock_mmap_for_io(vmf, fpin); 2530 2530 page_cache_async_readahead(mapping, ra, file, ··· 2692 2688 unsigned long max_idx; 2693 2689 XA_STATE(xas, &mapping->i_pages, start_pgoff); 2694 2690 struct page *page; 2691 + unsigned int mmap_miss = READ_ONCE(file->f_ra.mmap_miss); 2695 2692 2696 2693 rcu_read_lock(); 2697 2694 xas_for_each(&xas, page, end_pgoff) { ··· 2729 2724 if (page->index >= max_idx) 2730 2725 goto unlock; 2731 2726 2732 - if (file->f_ra.mmap_miss > 0) 2733 - file->f_ra.mmap_miss--; 2727 + if (mmap_miss > 0) 2728 + mmap_miss--; 2734 2729 2735 2730 vmf->address += (xas.xa_index - last_pgoff) << PAGE_SHIFT; 2736 2731 if (vmf->pte) ··· 2750 2745 break; 2751 2746 } 2752 2747 rcu_read_unlock(); 2748 + WRITE_ONCE(file->f_ra.mmap_miss, mmap_miss); 2753 2749 } 2754 2750 EXPORT_SYMBOL(filemap_map_pages); 2755 2751
+4 -4
mm/frontswap.c
··· 61 61 static u64 frontswap_invalidates; 62 62 63 63 static inline void inc_frontswap_loads(void) { 64 - frontswap_loads++; 64 + data_race(frontswap_loads++); 65 65 } 66 66 static inline void inc_frontswap_succ_stores(void) { 67 - frontswap_succ_stores++; 67 + data_race(frontswap_succ_stores++); 68 68 } 69 69 static inline void inc_frontswap_failed_stores(void) { 70 - frontswap_failed_stores++; 70 + data_race(frontswap_failed_stores++); 71 71 } 72 72 static inline void inc_frontswap_invalidates(void) { 73 - frontswap_invalidates++; 73 + data_race(frontswap_invalidates++); 74 74 } 75 75 #else 76 76 static inline void inc_frontswap_loads(void) { }
+1 -1
mm/gup.c
··· 1637 1637 mod_node_page_state(page_pgdat(head), 1638 1638 NR_ISOLATED_ANON + 1639 1639 page_is_file_lru(head), 1640 - hpage_nr_pages(head)); 1640 + thp_nr_pages(head)); 1641 1641 } 1642 1642 } 1643 1643 }
+2 -2
mm/internal.h
··· 369 369 static inline void mlock_migrate_page(struct page *newpage, struct page *page) 370 370 { 371 371 if (TestClearPageMlocked(page)) { 372 - int nr_pages = hpage_nr_pages(page); 372 + int nr_pages = thp_nr_pages(page); 373 373 374 374 /* Holding pmd lock, no change in irq context: __mod is safe */ 375 375 __mod_zone_page_state(page_zone(page), NR_MLOCK, -nr_pages); ··· 396 396 unsigned long start, end; 397 397 398 398 start = __vma_address(page, vma); 399 - end = start + PAGE_SIZE * (hpage_nr_pages(page) - 1); 399 + end = start + thp_size(page) - PAGE_SIZE; 400 400 401 401 /* page should be within @vma mapping range */ 402 402 VM_BUG_ON_VMA(end < vma->vm_start || start >= vma->vm_end, vma);
+2
mm/kmemleak.c
··· 1169 1169 u32 old_csum = object->checksum; 1170 1170 1171 1171 kasan_disable_current(); 1172 + kcsan_disable_current(); 1172 1173 object->checksum = crc32(0, (void *)object->pointer, object->size); 1173 1174 kasan_enable_current(); 1175 + kcsan_enable_current(); 1174 1176 1175 1177 return object->checksum != old_csum; 1176 1178 }
+1 -1
mm/list_lru.c
··· 180 180 181 181 rcu_read_lock(); 182 182 l = list_lru_from_memcg_idx(nlru, memcg_cache_id(memcg)); 183 - count = l->nr_items; 183 + count = READ_ONCE(l->nr_items); 184 184 rcu_read_unlock(); 185 185 186 186 return count;
+5 -5
mm/memcontrol.c
··· 5589 5589 { 5590 5590 struct lruvec *from_vec, *to_vec; 5591 5591 struct pglist_data *pgdat; 5592 - unsigned int nr_pages = compound ? hpage_nr_pages(page) : 1; 5592 + unsigned int nr_pages = compound ? thp_nr_pages(page) : 1; 5593 5593 int ret; 5594 5594 5595 5595 VM_BUG_ON(from == to); ··· 6682 6682 */ 6683 6683 int mem_cgroup_charge(struct page *page, struct mm_struct *mm, gfp_t gfp_mask) 6684 6684 { 6685 - unsigned int nr_pages = hpage_nr_pages(page); 6685 + unsigned int nr_pages = thp_nr_pages(page); 6686 6686 struct mem_cgroup *memcg = NULL; 6687 6687 int ret = 0; 6688 6688 ··· 6912 6912 return; 6913 6913 6914 6914 /* Force-charge the new page. The old one will be freed soon */ 6915 - nr_pages = hpage_nr_pages(newpage); 6915 + nr_pages = thp_nr_pages(newpage); 6916 6916 6917 6917 page_counter_charge(&memcg->memory, nr_pages); 6918 6918 if (do_memsw_account()) ··· 7114 7114 * ancestor for the swap instead and transfer the memory+swap charge. 7115 7115 */ 7116 7116 swap_memcg = mem_cgroup_id_get_online(memcg); 7117 - nr_entries = hpage_nr_pages(page); 7117 + nr_entries = thp_nr_pages(page); 7118 7118 /* Get references for the tail pages, too */ 7119 7119 if (nr_entries > 1) 7120 7120 mem_cgroup_id_get_many(swap_memcg, nr_entries - 1); ··· 7158 7158 */ 7159 7159 int mem_cgroup_try_charge_swap(struct page *page, swp_entry_t entry) 7160 7160 { 7161 - unsigned int nr_pages = hpage_nr_pages(page); 7161 + unsigned int nr_pages = thp_nr_pages(page); 7162 7162 struct page_counter *counter; 7163 7163 struct mem_cgroup *memcg; 7164 7164 unsigned short oldid;
+2 -2
mm/memory.c
··· 3128 3128 if (!page) { 3129 3129 struct swap_info_struct *si = swp_swap_info(entry); 3130 3130 3131 - if (si->flags & SWP_SYNCHRONOUS_IO && 3132 - __swap_count(entry) == 1) { 3131 + if (data_race(si->flags & SWP_SYNCHRONOUS_IO) && 3132 + __swap_count(entry) == 1) { 3133 3133 /* skip swapcache */ 3134 3134 page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, 3135 3135 vmf->address);
+3 -4
mm/memory_hotplug.c
··· 1299 1299 do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) 1300 1300 { 1301 1301 unsigned long pfn; 1302 - struct page *page; 1302 + struct page *page, *head; 1303 1303 int ret = 0; 1304 1304 LIST_HEAD(source); 1305 1305 ··· 1307 1307 if (!pfn_valid(pfn)) 1308 1308 continue; 1309 1309 page = pfn_to_page(pfn); 1310 + head = compound_head(page); 1310 1311 1311 1312 if (PageHuge(page)) { 1312 - struct page *head = compound_head(page); 1313 1313 pfn = page_to_pfn(head) + compound_nr(head) - 1; 1314 1314 isolate_huge_page(head, &source); 1315 1315 continue; 1316 1316 } else if (PageTransHuge(page)) 1317 - pfn = page_to_pfn(compound_head(page)) 1318 - + hpage_nr_pages(page) - 1; 1317 + pfn = page_to_pfn(head) + thp_nr_pages(page) - 1; 1319 1318 1320 1319 /* 1321 1320 * HWPoison pages have elevated reference counts so the migration would
+1 -1
mm/mempolicy.c
··· 1049 1049 list_add_tail(&head->lru, pagelist); 1050 1050 mod_node_page_state(page_pgdat(head), 1051 1051 NR_ISOLATED_ANON + page_is_file_lru(head), 1052 - hpage_nr_pages(head)); 1052 + thp_nr_pages(head)); 1053 1053 } else if (flags & MPOL_MF_STRICT) { 1054 1054 /* 1055 1055 * Non-movable page may reach here. And, there may be
+1 -1
mm/mempool.c
··· 489 489 * ensures that there will be frees which return elements to the 490 490 * pool waking up the waiters. 491 491 */ 492 - if (unlikely(pool->curr_nr < pool->min_nr)) { 492 + if (unlikely(READ_ONCE(pool->curr_nr) < pool->min_nr)) { 493 493 spin_lock_irqsave(&pool->lock, flags); 494 494 if (likely(pool->curr_nr < pool->min_nr)) { 495 495 add_element(pool, element);
+9 -9
mm/migrate.c
··· 193 193 put_page(page); 194 194 } else { 195 195 mod_node_page_state(page_pgdat(page), NR_ISOLATED_ANON + 196 - page_is_file_lru(page), -hpage_nr_pages(page)); 196 + page_is_file_lru(page), -thp_nr_pages(page)); 197 197 putback_lru_page(page); 198 198 } 199 199 } ··· 386 386 */ 387 387 expected_count += is_device_private_page(page); 388 388 if (mapping) 389 - expected_count += hpage_nr_pages(page) + page_has_private(page); 389 + expected_count += thp_nr_pages(page) + page_has_private(page); 390 390 391 391 return expected_count; 392 392 } ··· 441 441 */ 442 442 newpage->index = page->index; 443 443 newpage->mapping = page->mapping; 444 - page_ref_add(newpage, hpage_nr_pages(page)); /* add cache reference */ 444 + page_ref_add(newpage, thp_nr_pages(page)); /* add cache reference */ 445 445 if (PageSwapBacked(page)) { 446 446 __SetPageSwapBacked(newpage); 447 447 if (PageSwapCache(page)) { ··· 474 474 * to one less reference. 475 475 * We know this isn't the last reference. 476 476 */ 477 - page_ref_unfreeze(page, expected_count - hpage_nr_pages(page)); 477 + page_ref_unfreeze(page, expected_count - thp_nr_pages(page)); 478 478 479 479 xas_unlock(&xas); 480 480 /* Leave irq disabled to prevent preemption while updating stats */ ··· 591 591 } else { 592 592 /* thp page */ 593 593 BUG_ON(!PageTransHuge(src)); 594 - nr_pages = hpage_nr_pages(src); 594 + nr_pages = thp_nr_pages(src); 595 595 } 596 596 597 597 for (i = 0; i < nr_pages; i++) { ··· 1213 1213 */ 1214 1214 if (likely(!__PageMovable(page))) 1215 1215 mod_node_page_state(page_pgdat(page), NR_ISOLATED_ANON + 1216 - page_is_file_lru(page), -hpage_nr_pages(page)); 1216 + page_is_file_lru(page), -thp_nr_pages(page)); 1217 1217 } 1218 1218 1219 1219 /* ··· 1446 1446 * during migration. 1447 1447 */ 1448 1448 is_thp = PageTransHuge(page); 1449 - nr_subpages = hpage_nr_pages(page); 1449 + nr_subpages = thp_nr_pages(page); 1450 1450 cond_resched(); 1451 1451 1452 1452 if (PageHuge(page)) ··· 1670 1670 list_add_tail(&head->lru, pagelist); 1671 1671 mod_node_page_state(page_pgdat(head), 1672 1672 NR_ISOLATED_ANON + page_is_file_lru(head), 1673 - hpage_nr_pages(head)); 1673 + thp_nr_pages(head)); 1674 1674 } 1675 1675 out_putpage: 1676 1676 /* ··· 2034 2034 2035 2035 page_lru = page_is_file_lru(page); 2036 2036 mod_node_page_state(page_pgdat(page), NR_ISOLATED_ANON + page_lru, 2037 - hpage_nr_pages(page)); 2037 + thp_nr_pages(page)); 2038 2038 2039 2039 /* 2040 2040 * Isolating the page has taken another reference, so the
+4 -5
mm/mlock.c
··· 61 61 if (!TestClearPageMlocked(page)) 62 62 return; 63 63 64 - mod_zone_page_state(page_zone(page), NR_MLOCK, 65 - -hpage_nr_pages(page)); 64 + mod_zone_page_state(page_zone(page), NR_MLOCK, -thp_nr_pages(page)); 66 65 count_vm_event(UNEVICTABLE_PGCLEARED); 67 66 /* 68 67 * The previous TestClearPageMlocked() corresponds to the smp_mb() ··· 94 95 95 96 if (!TestSetPageMlocked(page)) { 96 97 mod_zone_page_state(page_zone(page), NR_MLOCK, 97 - hpage_nr_pages(page)); 98 + thp_nr_pages(page)); 98 99 count_vm_event(UNEVICTABLE_PGMLOCKED); 99 100 if (!isolate_lru_page(page)) 100 101 putback_lru_page(page); ··· 191 192 /* 192 193 * Serialize with any parallel __split_huge_page_refcount() which 193 194 * might otherwise copy PageMlocked to part of the tail pages before 194 - * we clear it in the head page. It also stabilizes hpage_nr_pages(). 195 + * we clear it in the head page. It also stabilizes thp_nr_pages(). 195 196 */ 196 197 spin_lock_irq(&pgdat->lru_lock); 197 198 ··· 201 202 goto unlock_out; 202 203 } 203 204 204 - nr_pages = hpage_nr_pages(page); 205 + nr_pages = thp_nr_pages(page); 205 206 __mod_zone_page_state(page_zone(page), NR_MLOCK, -nr_pages); 206 207 207 208 if (__munlock_isolate_lru_page(page, true)) {
+3 -2
mm/page_alloc.c
··· 666 666 int i; 667 667 int nr_pages = 1 << order; 668 668 669 - set_compound_page_dtor(page, COMPOUND_PAGE_DTOR); 670 - set_compound_order(page, order); 671 669 __SetPageHead(page); 672 670 for (i = 1; i < nr_pages; i++) { 673 671 struct page *p = page + i; ··· 673 675 p->mapping = TAIL_MAPPING; 674 676 set_compound_head(p, page); 675 677 } 678 + 679 + set_compound_page_dtor(page, COMPOUND_PAGE_DTOR); 680 + set_compound_order(page, order); 676 681 atomic_set(compound_mapcount_ptr(page), -1); 677 682 if (hpage_pincount_available(page)) 678 683 atomic_set(compound_pincount_ptr(page), 0);
+7 -6
mm/page_counter.c
··· 77 77 * This is indeed racy, but we can live with some 78 78 * inaccuracy in the watermark. 79 79 */ 80 - if (new > c->watermark) 81 - c->watermark = new; 80 + if (new > READ_ONCE(c->watermark)) 81 + WRITE_ONCE(c->watermark, new); 82 82 } 83 83 } 84 84 ··· 119 119 propagate_protected_usage(c, new); 120 120 /* 121 121 * This is racy, but we can live with some 122 - * inaccuracy in the failcnt. 122 + * inaccuracy in the failcnt which is only used 123 + * to report stats. 123 124 */ 124 - c->failcnt++; 125 + data_race(c->failcnt++); 125 126 *fail = c; 126 127 goto failed; 127 128 } ··· 131 130 * Just like with failcnt, we can live with some 132 131 * inaccuracy in the watermark. 133 132 */ 134 - if (new > c->watermark) 135 - c->watermark = new; 133 + if (new > READ_ONCE(c->watermark)) 134 + WRITE_ONCE(c->watermark, new); 136 135 } 137 136 return true; 138 137
+6 -6
mm/page_io.c
··· 40 40 bio->bi_iter.bi_sector <<= PAGE_SHIFT - 9; 41 41 bio->bi_end_io = end_io; 42 42 43 - bio_add_page(bio, page, PAGE_SIZE * hpage_nr_pages(page), 0); 43 + bio_add_page(bio, page, thp_size(page), 0); 44 44 } 45 45 return bio; 46 46 } ··· 85 85 return; 86 86 87 87 sis = page_swap_info(page); 88 - if (!(sis->flags & SWP_BLKDEV)) 88 + if (data_race(!(sis->flags & SWP_BLKDEV))) 89 89 return; 90 90 91 91 /* ··· 274 274 if (unlikely(PageTransHuge(page))) 275 275 count_vm_event(THP_SWPOUT); 276 276 #endif 277 - count_vm_events(PSWPOUT, hpage_nr_pages(page)); 277 + count_vm_events(PSWPOUT, thp_nr_pages(page)); 278 278 } 279 279 280 280 #if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP) ··· 302 302 struct swap_info_struct *sis = page_swap_info(page); 303 303 304 304 VM_BUG_ON_PAGE(!PageSwapCache(page), page); 305 - if (sis->flags & SWP_FS) { 305 + if (data_race(sis->flags & SWP_FS)) { 306 306 struct kiocb kiocb; 307 307 struct file *swap_file = sis->swap_file; 308 308 struct address_space *mapping = swap_file->f_mapping; ··· 393 393 goto out; 394 394 } 395 395 396 - if (sis->flags & SWP_FS) { 396 + if (data_race(sis->flags & SWP_FS)) { 397 397 struct file *swap_file = sis->swap_file; 398 398 struct address_space *mapping = swap_file->f_mapping; 399 399 ··· 455 455 { 456 456 struct swap_info_struct *sis = page_swap_info(page); 457 457 458 - if (sis->flags & SWP_FS) { 458 + if (data_race(sis->flags & SWP_FS)) { 459 459 struct address_space *mapping = sis->swap_file->f_mapping; 460 460 461 461 VM_BUG_ON_PAGE(!PageSwapCache(page), page);
+3 -3
mm/page_vma_mapped.c
··· 61 61 return page_pfn == pfn; 62 62 63 63 /* THP can be referenced by any subpage */ 64 - return pfn >= page_pfn && pfn - page_pfn < hpage_nr_pages(page); 64 + return pfn >= page_pfn && pfn - page_pfn < thp_nr_pages(page); 65 65 } 66 66 67 67 /** ··· 227 227 if (pvmw->address >= pvmw->vma->vm_end || 228 228 pvmw->address >= 229 229 __vma_address(pvmw->page, pvmw->vma) + 230 - hpage_nr_pages(pvmw->page) * PAGE_SIZE) 230 + thp_size(pvmw->page)) 231 231 return not_found(pvmw); 232 232 /* Did we cross page table boundary? */ 233 233 if (pvmw->address % PMD_SIZE == 0) { ··· 268 268 unsigned long start, end; 269 269 270 270 start = __vma_address(page, vma); 271 - end = start + PAGE_SIZE * (hpage_nr_pages(page) - 1); 271 + end = start + thp_size(page) - PAGE_SIZE; 272 272 273 273 if (unlikely(end < vma->vm_start || start >= vma->vm_end)) 274 274 return 0;
+5 -5
mm/rmap.c
··· 672 672 */ 673 673 void flush_tlb_batched_pending(struct mm_struct *mm) 674 674 { 675 - if (mm->tlb_flush_batched) { 675 + if (data_race(mm->tlb_flush_batched)) { 676 676 flush_tlb_mm(mm); 677 677 678 678 /* ··· 1130 1130 } 1131 1131 1132 1132 if (first) { 1133 - int nr = compound ? hpage_nr_pages(page) : 1; 1133 + int nr = compound ? thp_nr_pages(page) : 1; 1134 1134 /* 1135 1135 * We use the irq-unsafe __{inc|mod}_zone_page_stat because 1136 1136 * these counters are not modified in interrupt context, and ··· 1169 1169 void page_add_new_anon_rmap(struct page *page, 1170 1170 struct vm_area_struct *vma, unsigned long address, bool compound) 1171 1171 { 1172 - int nr = compound ? hpage_nr_pages(page) : 1; 1172 + int nr = compound ? thp_nr_pages(page) : 1; 1173 1173 1174 1174 VM_BUG_ON_VMA(address < vma->vm_start || address >= vma->vm_end, vma); 1175 1175 __SetPageSwapBacked(page); ··· 1860 1860 return; 1861 1861 1862 1862 pgoff_start = page_to_pgoff(page); 1863 - pgoff_end = pgoff_start + hpage_nr_pages(page) - 1; 1863 + pgoff_end = pgoff_start + thp_nr_pages(page) - 1; 1864 1864 anon_vma_interval_tree_foreach(avc, &anon_vma->rb_root, 1865 1865 pgoff_start, pgoff_end) { 1866 1866 struct vm_area_struct *vma = avc->vma; ··· 1913 1913 return; 1914 1914 1915 1915 pgoff_start = page_to_pgoff(page); 1916 - pgoff_end = pgoff_start + hpage_nr_pages(page) - 1; 1916 + pgoff_end = pgoff_start + thp_nr_pages(page) - 1; 1917 1917 if (!locked) 1918 1918 i_mmap_lock_read(mapping); 1919 1919 vma_interval_tree_foreach(vma, &mapping->i_mmap,
+11 -10
mm/swap.c
··· 241 241 del_page_from_lru_list(page, lruvec, page_lru(page)); 242 242 ClearPageActive(page); 243 243 add_page_to_lru_list_tail(page, lruvec, page_lru(page)); 244 - (*pgmoved) += hpage_nr_pages(page); 244 + (*pgmoved) += thp_nr_pages(page); 245 245 } 246 246 } 247 247 ··· 312 312 void lru_note_cost_page(struct page *page) 313 313 { 314 314 lru_note_cost(mem_cgroup_page_lruvec(page, page_pgdat(page)), 315 - page_is_file_lru(page), hpage_nr_pages(page)); 315 + page_is_file_lru(page), thp_nr_pages(page)); 316 316 } 317 317 318 318 static void __activate_page(struct page *page, struct lruvec *lruvec, ··· 320 320 { 321 321 if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) { 322 322 int lru = page_lru_base_type(page); 323 - int nr_pages = hpage_nr_pages(page); 323 + int nr_pages = thp_nr_pages(page); 324 324 325 325 del_page_from_lru_list(page, lruvec, lru); 326 326 SetPageActive(page); ··· 500 500 * lock is held(spinlock), which implies preemption disabled. 501 501 */ 502 502 __mod_zone_page_state(page_zone(page), NR_MLOCK, 503 - hpage_nr_pages(page)); 503 + thp_nr_pages(page)); 504 504 count_vm_event(UNEVICTABLE_PGMLOCKED); 505 505 } 506 506 lru_cache_add(page); ··· 532 532 { 533 533 int lru; 534 534 bool active; 535 - int nr_pages = hpage_nr_pages(page); 535 + int nr_pages = thp_nr_pages(page); 536 536 537 537 if (!PageLRU(page)) 538 538 return; ··· 580 580 { 581 581 if (PageLRU(page) && PageActive(page) && !PageUnevictable(page)) { 582 582 int lru = page_lru_base_type(page); 583 - int nr_pages = hpage_nr_pages(page); 583 + int nr_pages = thp_nr_pages(page); 584 584 585 585 del_page_from_lru_list(page, lruvec, lru + LRU_ACTIVE); 586 586 ClearPageActive(page); ··· 599 599 if (PageLRU(page) && PageAnon(page) && PageSwapBacked(page) && 600 600 !PageSwapCache(page) && !PageUnevictable(page)) { 601 601 bool active = PageActive(page); 602 - int nr_pages = hpage_nr_pages(page); 602 + int nr_pages = thp_nr_pages(page); 603 603 604 604 del_page_from_lru_list(page, lruvec, 605 605 LRU_INACTIVE_ANON + active); ··· 632 632 __pagevec_lru_add(pvec); 633 633 634 634 pvec = &per_cpu(lru_rotate.pvec, cpu); 635 - if (pagevec_count(pvec)) { 635 + /* Disabling interrupts below acts as a compiler barrier. */ 636 + if (data_race(pagevec_count(pvec))) { 636 637 unsigned long flags; 637 638 638 639 /* No harm done if a racing interrupt already did this */ ··· 794 793 struct work_struct *work = &per_cpu(lru_add_drain_work, cpu); 795 794 796 795 if (pagevec_count(&per_cpu(lru_pvecs.lru_add, cpu)) || 797 - pagevec_count(&per_cpu(lru_rotate.pvec, cpu)) || 796 + data_race(pagevec_count(&per_cpu(lru_rotate.pvec, cpu))) || 798 797 pagevec_count(&per_cpu(lru_pvecs.lru_deactivate_file, cpu)) || 799 798 pagevec_count(&per_cpu(lru_pvecs.lru_deactivate, cpu)) || 800 799 pagevec_count(&per_cpu(lru_pvecs.lru_lazyfree, cpu)) || ··· 973 972 { 974 973 enum lru_list lru; 975 974 int was_unevictable = TestClearPageUnevictable(page); 976 - int nr_pages = hpage_nr_pages(page); 975 + int nr_pages = thp_nr_pages(page); 977 976 978 977 VM_BUG_ON_PAGE(PageLRU(page), page); 979 978
+5 -5
mm/swap_state.c
··· 57 57 #define GET_SWAP_RA_VAL(vma) \ 58 58 (atomic_long_read(&(vma)->swap_readahead_info) ? : 4) 59 59 60 - #define INC_CACHE_INFO(x) do { swap_cache_info.x++; } while (0) 61 - #define ADD_CACHE_INFO(x, nr) do { swap_cache_info.x += (nr); } while (0) 60 + #define INC_CACHE_INFO(x) data_race(swap_cache_info.x++) 61 + #define ADD_CACHE_INFO(x, nr) data_race(swap_cache_info.x += (nr)) 62 62 63 63 static struct { 64 64 unsigned long add_total; ··· 130 130 struct address_space *address_space = swap_address_space(entry); 131 131 pgoff_t idx = swp_offset(entry); 132 132 XA_STATE_ORDER(xas, &address_space->i_pages, idx, compound_order(page)); 133 - unsigned long i, nr = hpage_nr_pages(page); 133 + unsigned long i, nr = thp_nr_pages(page); 134 134 void *old; 135 135 136 136 VM_BUG_ON_PAGE(!PageLocked(page), page); ··· 183 183 swp_entry_t entry, void *shadow) 184 184 { 185 185 struct address_space *address_space = swap_address_space(entry); 186 - int i, nr = hpage_nr_pages(page); 186 + int i, nr = thp_nr_pages(page); 187 187 pgoff_t idx = swp_offset(entry); 188 188 XA_STATE(xas, &address_space->i_pages, idx); 189 189 ··· 278 278 xa_unlock_irq(&address_space->i_pages); 279 279 280 280 put_swap_page(page, entry); 281 - page_ref_sub(page, hpage_nr_pages(page)); 281 + page_ref_sub(page, thp_nr_pages(page)); 282 282 } 283 283 284 284 void clear_shadow_from_swap_cache(int type, unsigned long begin,
+19 -14
mm/swapfile.c
··· 672 672 if (offset == si->lowest_bit) 673 673 si->lowest_bit += nr_entries; 674 674 if (end == si->highest_bit) 675 - si->highest_bit -= nr_entries; 675 + WRITE_ONCE(si->highest_bit, si->highest_bit - nr_entries); 676 676 si->inuse_pages += nr_entries; 677 677 if (si->inuse_pages == si->pages) { 678 678 si->lowest_bit = si->max; ··· 705 705 if (end > si->highest_bit) { 706 706 bool was_full = !si->highest_bit; 707 707 708 - si->highest_bit = end; 708 + WRITE_ONCE(si->highest_bit, end); 709 709 if (was_full && (si->flags & SWP_WRITEOK)) 710 710 add_to_avail_list(si); 711 711 } ··· 870 870 else 871 871 goto done; 872 872 } 873 - si->swap_map[offset] = usage; 873 + WRITE_ONCE(si->swap_map[offset], usage); 874 874 inc_cluster_info_page(si, si->cluster_info, offset); 875 875 unlock_cluster(ci); 876 876 ··· 929 929 930 930 scan: 931 931 spin_unlock(&si->lock); 932 - while (++offset <= si->highest_bit) { 933 - if (!si->swap_map[offset]) { 932 + while (++offset <= READ_ONCE(si->highest_bit)) { 933 + if (data_race(!si->swap_map[offset])) { 934 934 spin_lock(&si->lock); 935 935 goto checks; 936 936 } 937 - if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) { 937 + if (vm_swap_full() && 938 + READ_ONCE(si->swap_map[offset]) == SWAP_HAS_CACHE) { 938 939 spin_lock(&si->lock); 939 940 goto checks; 940 941 } ··· 947 946 } 948 947 offset = si->lowest_bit; 949 948 while (offset < scan_base) { 950 - if (!si->swap_map[offset]) { 949 + if (data_race(!si->swap_map[offset])) { 951 950 spin_lock(&si->lock); 952 951 goto checks; 953 952 } 954 - if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) { 953 + if (vm_swap_full() && 954 + READ_ONCE(si->swap_map[offset]) == SWAP_HAS_CACHE) { 955 955 spin_lock(&si->lock); 956 956 goto checks; 957 957 } ··· 1151 1149 p = swp_swap_info(entry); 1152 1150 if (!p) 1153 1151 goto bad_nofile; 1154 - if (!(p->flags & SWP_USED)) 1152 + if (data_race(!(p->flags & SWP_USED))) 1155 1153 goto bad_device; 1156 1154 offset = swp_offset(entry); 1157 1155 if (offset >= p->max) ··· 1177 1175 p = __swap_info_get(entry); 1178 1176 if (!p) 1179 1177 goto out; 1180 - if (!p->swap_map[swp_offset(entry)]) 1178 + if (data_race(!p->swap_map[swp_offset(entry)])) 1181 1179 goto bad_free; 1182 1180 return p; 1183 1181 ··· 1246 1244 } 1247 1245 1248 1246 usage = count | has_cache; 1249 - p->swap_map[offset] = usage ? : SWAP_HAS_CACHE; 1247 + if (usage) 1248 + WRITE_ONCE(p->swap_map[offset], usage); 1249 + else 1250 + WRITE_ONCE(p->swap_map[offset], SWAP_HAS_CACHE); 1250 1251 1251 1252 return usage; 1252 1253 } ··· 1301 1296 goto bad_nofile; 1302 1297 1303 1298 rcu_read_lock(); 1304 - if (!(si->flags & SWP_VALID)) 1299 + if (data_race(!(si->flags & SWP_VALID))) 1305 1300 goto unlock_out; 1306 1301 offset = swp_offset(entry); 1307 1302 if (offset >= si->max) ··· 1375 1370 unsigned char *map; 1376 1371 unsigned int i, free_entries = 0; 1377 1372 unsigned char val; 1378 - int size = swap_entry_size(hpage_nr_pages(page)); 1373 + int size = swap_entry_size(thp_nr_pages(page)); 1379 1374 1380 1375 si = _swap_info_get(entry); 1381 1376 if (!si) ··· 3489 3484 } else 3490 3485 err = -ENOENT; /* unused swap entry */ 3491 3486 3492 - p->swap_map[offset] = count | has_cache; 3487 + WRITE_ONCE(p->swap_map[offset], count | has_cache); 3493 3488 3494 3489 unlock_out: 3495 3490 unlock_cluster_or_swap_info(p, ci);
+3 -3
mm/vmscan.c
··· 1354 1354 case PAGE_ACTIVATE: 1355 1355 goto activate_locked; 1356 1356 case PAGE_SUCCESS: 1357 - stat->nr_pageout += hpage_nr_pages(page); 1357 + stat->nr_pageout += thp_nr_pages(page); 1358 1358 1359 1359 if (PageWriteback(page)) 1360 1360 goto keep; ··· 1862 1862 SetPageLRU(page); 1863 1863 lru = page_lru(page); 1864 1864 1865 - nr_pages = hpage_nr_pages(page); 1865 + nr_pages = thp_nr_pages(page); 1866 1866 update_lru_size(lruvec, lru, page_zonenum(page), nr_pages); 1867 1867 list_move(&page->lru, &lruvec->lists[lru]); 1868 1868 ··· 2065 2065 * so we ignore them here. 2066 2066 */ 2067 2067 if ((vm_flags & VM_EXEC) && page_is_file_lru(page)) { 2068 - nr_rotated += hpage_nr_pages(page); 2068 + nr_rotated += thp_nr_pages(page); 2069 2069 list_add(&page->lru, &l_active); 2070 2070 continue; 2071 2071 }
+6 -6
mm/vmstat.c
··· 1642 1642 zone->present_pages, 1643 1643 zone_managed_pages(zone)); 1644 1644 1645 - /* If unpopulated, no other information is useful */ 1646 - if (!populated_zone(zone)) { 1647 - seq_putc(m, '\n'); 1648 - return; 1649 - } 1650 - 1651 1645 seq_printf(m, 1652 1646 "\n protection: (%ld", 1653 1647 zone->lowmem_reserve[0]); 1654 1648 for (i = 1; i < ARRAY_SIZE(zone->lowmem_reserve); i++) 1655 1649 seq_printf(m, ", %ld", zone->lowmem_reserve[i]); 1656 1650 seq_putc(m, ')'); 1651 + 1652 + /* If unpopulated, no other information is useful */ 1653 + if (!populated_zone(zone)) { 1654 + seq_putc(m, '\n'); 1655 + return; 1656 + } 1657 1657 1658 1658 for (i = 0; i < NR_VM_ZONE_STAT_ITEMS; i++) 1659 1659 seq_printf(m, "\n %-12s %lu", zone_stat_name(i),
+3 -3
mm/workingset.c
··· 263 263 VM_BUG_ON_PAGE(!PageLocked(page), page); 264 264 265 265 lruvec = mem_cgroup_lruvec(target_memcg, pgdat); 266 - workingset_age_nonresident(lruvec, hpage_nr_pages(page)); 266 + workingset_age_nonresident(lruvec, thp_nr_pages(page)); 267 267 /* XXX: target_memcg can be NULL, go through lruvec */ 268 268 memcgid = mem_cgroup_id(lruvec_memcg(lruvec)); 269 269 eviction = atomic_long_read(&lruvec->nonresident_age); ··· 374 374 goto out; 375 375 376 376 SetPageActive(page); 377 - workingset_age_nonresident(lruvec, hpage_nr_pages(page)); 377 + workingset_age_nonresident(lruvec, thp_nr_pages(page)); 378 378 inc_lruvec_state(lruvec, WORKINGSET_ACTIVATE_BASE + file); 379 379 380 380 /* Page was active prior to eviction */ ··· 411 411 if (!mem_cgroup_disabled() && !memcg) 412 412 goto out; 413 413 lruvec = mem_cgroup_page_lruvec(page, page_pgdat(page)); 414 - workingset_age_nonresident(lruvec, hpage_nr_pages(page)); 414 + workingset_age_nonresident(lruvec, thp_nr_pages(page)); 415 415 out: 416 416 rcu_read_unlock(); 417 417 }
+1 -1
tools/perf/arch/powerpc/entry/syscalls/syscall.tbl
··· 193 193 146 common writev sys_writev compat_sys_writev 194 194 147 common getsid sys_getsid 195 195 148 common fdatasync sys_fdatasync 196 - 149 nospu _sysctl sys_sysctl compat_sys_sysctl 196 + 149 nospu _sysctl sys_ni_syscall 197 197 150 common mlock sys_mlock 198 198 151 common munlock sys_munlock 199 199 152 common mlockall sys_mlockall
+1 -1
tools/perf/arch/s390/entry/syscalls/syscall.tbl
··· 138 138 146 common writev sys_writev compat_sys_writev 139 139 147 common getsid sys_getsid sys_getsid 140 140 148 common fdatasync sys_fdatasync sys_fdatasync 141 - 149 common _sysctl sys_sysctl compat_sys_sysctl 141 + 149 common _sysctl - - 142 142 150 common mlock sys_mlock compat_sys_mlock 143 143 151 common munlock sys_munlock compat_sys_munlock 144 144 152 common mlockall sys_mlockall sys_mlockall
+1 -1
tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
··· 164 164 153 common vhangup sys_vhangup 165 165 154 common modify_ldt sys_modify_ldt 166 166 155 common pivot_root sys_pivot_root 167 - 156 64 _sysctl sys_sysctl 167 + 156 64 _sysctl sys_ni_syscall 168 168 157 common prctl sys_prctl 169 169 158 common arch_prctl sys_arch_prctl 170 170 159 common adjtimex sys_adjtimex
+1
tools/testing/selftests/exec/.gitignore
··· 10 10 /recursion-depth 11 11 xxxxxxxx* 12 12 pipe 13 + S_I*.test
+3 -2
tools/testing/selftests/exec/Makefile
··· 3 3 CFLAGS += -Wno-nonnull 4 4 CFLAGS += -D_GNU_SOURCE 5 5 6 - TEST_PROGS := binfmt_script 6 + TEST_PROGS := binfmt_script non-regular 7 7 TEST_GEN_PROGS := execveat 8 8 TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir pipe 9 9 # Makefile is a run-time dependency, since it's accessed by the execveat test ··· 11 11 12 12 TEST_GEN_PROGS += recursion-depth 13 13 14 - EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx* 14 + EXTRA_CLEAN := $(OUTPUT)/subdir.moved $(OUTPUT)/execveat.moved $(OUTPUT)/xxxxx* \ 15 + $(OUTPUT)/S_I*.test 15 16 16 17 include ../lib.mk 17 18
+196
tools/testing/selftests/exec/non-regular.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + #include <errno.h> 3 + #include <fcntl.h> 4 + #include <stdio.h> 5 + #include <string.h> 6 + #include <unistd.h> 7 + #include <sys/socket.h> 8 + #include <sys/stat.h> 9 + #include <sys/sysmacros.h> 10 + #include <sys/types.h> 11 + 12 + #include "../kselftest_harness.h" 13 + 14 + /* Remove a file, ignoring the result if it didn't exist. */ 15 + void rm(struct __test_metadata *_metadata, const char *pathname, 16 + int is_dir) 17 + { 18 + int rc; 19 + 20 + if (is_dir) 21 + rc = rmdir(pathname); 22 + else 23 + rc = unlink(pathname); 24 + 25 + if (rc < 0) { 26 + ASSERT_EQ(errno, ENOENT) { 27 + TH_LOG("Not ENOENT: %s", pathname); 28 + } 29 + } else { 30 + ASSERT_EQ(rc, 0) { 31 + TH_LOG("Failed to remove: %s", pathname); 32 + } 33 + } 34 + } 35 + 36 + FIXTURE(file) { 37 + char *pathname; 38 + int is_dir; 39 + }; 40 + 41 + FIXTURE_VARIANT(file) 42 + { 43 + const char *name; 44 + int expected; 45 + int is_dir; 46 + void (*setup)(struct __test_metadata *_metadata, 47 + FIXTURE_DATA(file) *self, 48 + const FIXTURE_VARIANT(file) *variant); 49 + int major, minor, mode; /* for mknod() */ 50 + }; 51 + 52 + void setup_link(struct __test_metadata *_metadata, 53 + FIXTURE_DATA(file) *self, 54 + const FIXTURE_VARIANT(file) *variant) 55 + { 56 + const char * const paths[] = { 57 + "/bin/true", 58 + "/usr/bin/true", 59 + }; 60 + int i; 61 + 62 + for (i = 0; i < ARRAY_SIZE(paths); i++) { 63 + if (access(paths[i], X_OK) == 0) { 64 + ASSERT_EQ(symlink(paths[i], self->pathname), 0); 65 + return; 66 + } 67 + } 68 + ASSERT_EQ(1, 0) { 69 + TH_LOG("Could not find viable 'true' binary"); 70 + } 71 + } 72 + 73 + FIXTURE_VARIANT_ADD(file, S_IFLNK) 74 + { 75 + .name = "S_IFLNK", 76 + .expected = ELOOP, 77 + .setup = setup_link, 78 + }; 79 + 80 + void setup_dir(struct __test_metadata *_metadata, 81 + FIXTURE_DATA(file) *self, 82 + const FIXTURE_VARIANT(file) *variant) 83 + { 84 + ASSERT_EQ(mkdir(self->pathname, 0755), 0); 85 + } 86 + 87 + FIXTURE_VARIANT_ADD(file, S_IFDIR) 88 + { 89 + .name = "S_IFDIR", 90 + .is_dir = 1, 91 + .expected = EACCES, 92 + .setup = setup_dir, 93 + }; 94 + 95 + void setup_node(struct __test_metadata *_metadata, 96 + FIXTURE_DATA(file) *self, 97 + const FIXTURE_VARIANT(file) *variant) 98 + { 99 + dev_t dev; 100 + int rc; 101 + 102 + dev = makedev(variant->major, variant->minor); 103 + rc = mknod(self->pathname, 0755 | variant->mode, dev); 104 + ASSERT_EQ(rc, 0) { 105 + if (errno == EPERM) 106 + SKIP(return, "Please run as root; cannot mknod(%s)", 107 + variant->name); 108 + } 109 + } 110 + 111 + FIXTURE_VARIANT_ADD(file, S_IFBLK) 112 + { 113 + .name = "S_IFBLK", 114 + .expected = EACCES, 115 + .setup = setup_node, 116 + /* /dev/loop0 */ 117 + .major = 7, 118 + .minor = 0, 119 + .mode = S_IFBLK, 120 + }; 121 + 122 + FIXTURE_VARIANT_ADD(file, S_IFCHR) 123 + { 124 + .name = "S_IFCHR", 125 + .expected = EACCES, 126 + .setup = setup_node, 127 + /* /dev/zero */ 128 + .major = 1, 129 + .minor = 5, 130 + .mode = S_IFCHR, 131 + }; 132 + 133 + void setup_fifo(struct __test_metadata *_metadata, 134 + FIXTURE_DATA(file) *self, 135 + const FIXTURE_VARIANT(file) *variant) 136 + { 137 + ASSERT_EQ(mkfifo(self->pathname, 0755), 0); 138 + } 139 + 140 + FIXTURE_VARIANT_ADD(file, S_IFIFO) 141 + { 142 + .name = "S_IFIFO", 143 + .expected = EACCES, 144 + .setup = setup_fifo, 145 + }; 146 + 147 + FIXTURE_SETUP(file) 148 + { 149 + ASSERT_GT(asprintf(&self->pathname, "%s.test", variant->name), 6); 150 + self->is_dir = variant->is_dir; 151 + 152 + rm(_metadata, self->pathname, variant->is_dir); 153 + variant->setup(_metadata, self, variant); 154 + } 155 + 156 + FIXTURE_TEARDOWN(file) 157 + { 158 + rm(_metadata, self->pathname, self->is_dir); 159 + } 160 + 161 + TEST_F(file, exec_errno) 162 + { 163 + char * const argv[2] = { (char * const)self->pathname, NULL }; 164 + 165 + EXPECT_LT(execv(argv[0], argv), 0); 166 + EXPECT_EQ(errno, variant->expected); 167 + } 168 + 169 + /* S_IFSOCK */ 170 + FIXTURE(sock) 171 + { 172 + int fd; 173 + }; 174 + 175 + FIXTURE_SETUP(sock) 176 + { 177 + self->fd = socket(AF_INET, SOCK_STREAM, 0); 178 + ASSERT_GE(self->fd, 0); 179 + } 180 + 181 + FIXTURE_TEARDOWN(sock) 182 + { 183 + if (self->fd >= 0) 184 + ASSERT_EQ(close(self->fd), 0); 185 + } 186 + 187 + TEST_F(sock, exec_errno) 188 + { 189 + char * const argv[2] = { " magic socket ", NULL }; 190 + char * const envp[1] = { NULL }; 191 + 192 + EXPECT_LT(fexecve(self->fd, argv, envp), 0); 193 + EXPECT_EQ(errno, EACCES); 194 + } 195 + 196 + TEST_HARNESS_MAIN