android_kernel_oneplus_msm8998/arch/sparc/include/asm
Mike Kravetz cc014084cb sparc64 mm: Fix more TSB sizing issues
[ Upstream commit 1e953d846ac015fbfcf09c857e8f893924cb629c ]

Commit af1b1a9b36b8 ("sparc64 mm: Fix base TSB sizing when hugetlb
pages are used") addressed the difference between hugetlb and THP
pages when computing TSB sizes.  The following additional issues
were also discovered while working with the code.

In order to save memory, THP makes use of a huge zero page.  This huge
zero page does not count against a task's RSS, but it does consume TSB
entries.  This is similar to hugetlb pages.  Therefore, count huge
zero page entries in hugetlb_pte_count.

Accounting of THP pages is done in the routine set_pmd_at().
Unfortunately, this does not catch the case where a THP page is split.
To handle this case, decrement the count in pmdp_invalidate().
pmdp_invalidate is only called when splitting a THP.  However, 'sanity
checks' are added in case it is ever called for other purposes.

A more general issue exists with HPAGE_SIZE accounting.
hugetlb_pte_count tracks the number of HPAGE_SIZE (8M) pages.  This
value is used to size the TSB for HPAGE_SIZE pages.  However,
each HPAGE_SIZE page consists of two REAL_HPAGE_SIZE (4M) pages.
The TSB contains an entry for each REAL_HPAGE_SIZE page.  Therefore,
the number of REAL_HPAGE_SIZE pages should be used to size the huge
page TSB.  A new compile time constant REAL_HPAGE_PER_HPAGE is used
to multiply hugetlb_pte_count before sizing the TSB.

Changes from V1
- Fixed build issue if hugetlb or THP not configured

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-10 07:41:39 -08:00
..
agp.h
apb.h
asm-offsets.h
asm.h
asmmacro.h sparc32: add support for run-time patching of leon/sun single instructions 2012-05-27 23:52:43 -07:00
atomic.h
atomic_32.h atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
atomic_64.h sparc64: Make atomic_xchg() an inline function rather than a macro. 2018-05-30 07:49:08 +02:00
auxio.h sparc32: fix sparse warnings in auxio_32.c 2014-04-29 01:12:26 -04:00
auxio_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
auxio_64.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
backoff.h sparc64: Improvde documentation and readability of atomic backoff code. 2012-10-28 13:04:47 -07:00
barrier.h Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
barrier_32.h arch: Clean up asm/barrier.h implementations using asm-generic/barrier.h 2014-01-12 10:37:15 +01:00
barrier_64.h locking, arch: use WRITE_ONCE()/READ_ONCE() in smp_store_release()/smp_load_acquire() 2015-08-03 10:59:30 +02:00
bbc.h
bitext.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
bitops.h
bitops_32.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2014-06-19 07:50:07 -10:00
bitops_64.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2014-06-19 07:50:07 -10:00
btext.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
bug.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
bugs.h
cache.h sparc32: Remove completely unused code from asm/cache.h 2012-05-19 21:15:37 -07:00
cacheflush.h sparc32: use flushi when run-time patching in per_cpu_patch 2012-05-20 13:33:36 -07:00
cacheflush_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
cacheflush_64.h mm/debug_pagealloc: fix build failure on ppc and some other archs 2015-02-05 13:35:30 -08:00
cachetlb_32.h sparc32: Move cache and TLB flushes over to method ops. 2012-05-13 20:49:31 -07:00
chafsr.h
checksum.h
checksum_32.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2014-06-19 07:50:07 -10:00
checksum_64.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2014-06-19 07:50:07 -10:00
chmctrl.h
clock.h
cmpxchg.h Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
cmpxchg_32.h arch: Remove __ARCH_HAVE_CMPXCHG 2015-05-13 10:55:42 +02:00
cmpxchg_64.h arch: Remove __ARCH_HAVE_CMPXCHG 2015-05-13 10:55:42 +02:00
compat.h sparc64: Make montmul/montsqr/mpmul usable in 32-bit threads. 2012-10-26 15:18:37 -07:00
compat_signal.h sparc: switch to generic sigaltstack 2013-02-03 18:16:17 -05:00
contregs.h sparc32: Remove sun4{,c} control reg definitions from contregs.h. 2012-05-11 21:29:17 -07:00
cpu_type.h sparc32: Remove sun4 and sun4c from enum sparc_cpu. 2012-05-12 00:23:23 -07:00
cpudata.h sparc: fix sparse warnings in cpu.c 2014-04-29 01:12:25 -04:00
cpudata_32.h sparc: Replace __get_cpu_var uses 2014-08-26 13:45:55 -04:00
cpudata_64.h sparc64: Setup sysfs to mark LDOM sockets, cores and threads correctly 2015-04-22 15:42:56 -04:00
current.h
dcr.h
dcu.h
delay.h
delay_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
delay_64.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
device.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
dma-mapping.h dma-mapping: consolidate dma_set_mask 2015-09-10 13:29:01 -07:00
dma.h sparc32: Convert mmu_* interfaces from btfixup to method ops. 2012-05-13 13:57:05 -07:00
ebus_dma.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
ecc.h
eeprom.h
elf.h
elf_32.h default SET_PERSONALITY() in linux/elf.h 2013-02-26 02:46:08 -05:00
elf_64.h sparc64: Add ADI capability to cpu capabilities 2015-12-24 12:05:06 -05:00
estate.h
fb.h sparc: Really fix "console=" for serial consoles. 2010-08-16 12:26:09 -07:00
fbio.h UAPI: (Scripted) Disintegrate arch/sparc/include/asm 2012-10-09 09:47:43 +01:00
fhc.h
floppy.h
floppy_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
floppy_64.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
fpumacro.h
ftrace.h ftrace: Format MCOUNT_ADDR address as type unsigned long 2015-07-20 22:30:53 -04:00
futex.h
futex_32.h
futex_64.h futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
gpio.h gpiolib/arches: Centralise bolierplate asm/gpio.h 2012-05-11 18:00:14 -06:00
hardirq.h
hardirq_32.h hardirq: Make hardirq bits generic 2013-11-13 20:21:46 +01:00
hardirq_64.h hardirq: Make hardirq bits generic 2013-11-13 20:21:46 +01:00
head.h
head_32.h sparc: Consistently use 'wr' and 'rd' instructions for ASRs. 2013-04-06 17:51:48 -04:00
head_64.h sparc64: Fix return from trap window fill crashes. 2016-06-24 10:18:21 -07:00
hibernate.h sparc64: Hibernation support 2013-03-20 11:06:54 -07:00
highmem.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
hugetlb.h mm/hugetlb: remove arch_prepare/release_hugepage from arch headers 2015-06-25 17:00:35 -07:00
hvtramp.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
hw_irq.h
hypervisor.h sparc: perf: Add support M7 processor 2015-03-19 18:54:49 -07:00
ide.h
idprom.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
intr_queue.h
io-unit.h sparc32: fix sparse warning in io-unit.c 2014-05-18 19:01:26 -07:00
io.h sparc: io: remove duplicate relaxed accessors on sparc32 2014-11-19 10:19:45 +01:00
io_32.h arch/*/io.h: Add ioremap_wt() to all architectures 2015-06-07 15:28:57 +02:00
io_64.h arch/*/io.h: Add ioremap_wt() to all architectures 2015-06-07 15:28:57 +02:00
ioctls.h UAPI: (Scripted) Disintegrate arch/sparc/include/asm 2012-10-09 09:47:43 +01:00
iommu.h
iommu_32.h sparc32: fix sparse warning in iommu.c 2014-05-18 19:01:26 -07:00
iommu_64.h sparc: Make sparc64 use scalable lib/iommu-common.c functions 2015-04-18 12:32:59 -07:00
irq.h
irq_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
irq_64.h sparc64: sparse irq 2014-10-05 16:53:40 -07:00
irqflags.h
irqflags_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
irqflags_64.h sparc/irqs: Do not trace arch_local_{*,irq_*} functions 2011-07-06 08:00:29 -07:00
jump_label.h locking/static_keys: Add a new static_key interface 2015-08-03 11:34:15 +02:00
Kbuild mm: clean up per architecture MM hook header files 2015-07-17 16:39:53 -07:00
kdebug.h
kdebug_32.h
kdebug_64.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
kgdb.h sparc64: fix sparse warning in kgdb_64.c 2014-05-18 19:01:34 -07:00
kmap_types.h
kprobes.h sparc64: fix sparse warning in kprobes.c 2014-05-18 19:01:34 -07:00
ldc.h sparc/ldc: create separate ldc_unbind from ldc_free 2014-12-11 18:52:45 -08:00
leon.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
leon_amba.h sparc32, leon: Remove separate "ticker" timer for SMP 2013-06-19 02:10:29 -07:00
leon_pci.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
lsu.h
machines.h sparc32: Trivial removal of sun4c references in comments. 2012-05-12 00:35:45 -07:00
mbus.h sparc32: Remove cypress cpu support. 2012-05-15 10:22:00 -07:00
mc146818rtc.h sparc32: fix sparse warnings in time_32.c 2014-05-18 19:01:27 -07:00
mc146818rtc_32.h
mc146818rtc_64.h
mdesc.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
memctrl.h
mman.h UAPI: (Scripted) Disintegrate arch/sparc/include/asm 2012-10-09 09:47:43 +01:00
mmu.h
mmu_32.h sparc32: add irq + smp declarations to headers 2011-03-16 18:19:08 -07:00
mmu_64.h sparc64: redefine first version 2017-06-14 13:16:20 +02:00
mmu_context.h
mmu_context_32.h sparc32: centralize all mmu context handling in srmmu.c 2012-07-26 16:46:16 -07:00
mmu_context_64.h sparc64: Prevent perf from running during super critical sections 2017-08-12 19:29:09 -07:00
mmzone.h Fix node_start/end_pfn() definition for mm/page_cgroup.c 2011-06-27 14:13:09 -07:00
msi.h
mxcc.h
nmi.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
ns87303.h Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
obio.h sparc32: move smp ipi to method ops 2012-05-14 14:05:07 -07:00
openprom.h sparc: Pass buffer pointer all the way down to prom_{get,put}char(). 2010-11-30 14:33:29 -08:00
oplib.h
oplib_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
oplib_64.h sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
page.h sparc: move page_to_phys to page.h 2014-05-02 01:30:20 -04:00
page_32.h sparc32: drop sparc_unmapped_base 2012-07-26 16:46:16 -07:00
page_64.h sparc64 mm: Fix more TSB sizing issues 2018-11-10 07:41:39 -08:00
parport.h sparc: include: asm: drop owner assignment from platform_drivers 2014-10-20 16:20:14 +02:00
pbm.h
pci.h pci-dma: add linux/pci-dma.h to linux/pci.h 2010-03-12 15:52:42 -08:00
pci_32.h PCI: Remove unused pci_dma_burst_advice() 2015-06-08 07:56:43 -05:00
pci_64.h PCI: Remove unused pci_dma_burst_advice() 2015-06-08 07:56:43 -05:00
pcic.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
pcr.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
percpu.h
percpu_32.h
percpu_64.h
perf_event.h perf, arch: Cleanup perf-pmu init vs lockup-detector 2010-11-26 15:14:56 +01:00
pgalloc.h
pgalloc_32.h sparc32: fix sparse warnings in ioport.c 2014-04-29 01:12:25 -04:00
pgalloc_64.h sparc64: Switch to 4-level page tables. 2014-10-05 16:53:38 -07:00
pgtable.h
pgtable_32.h sparc: Fix -Wstringop-overflow warning 2017-06-07 12:05:56 +02:00
pgtable_64.h sparc64: Fix kernel panic due to erroneous #ifdef surrounding pmd_write() 2017-05-02 21:19:50 -07:00
pgtsrmmu.h sparc: drop pte_file()-related helpers 2015-02-10 14:30:33 -08:00
pil.h sparc64: delete old wrap code 2017-06-14 13:16:20 +02:00
processor.h Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
processor_32.h arch, locking: Ciao arch_mutex_cpu_relax() 2014-07-17 12:32:47 +02:00
processor_64.h arch, locking: Ciao arch_mutex_cpu_relax() 2014-07-17 12:32:47 +02:00
prom.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
psr.h UAPI: (Scripted) Disintegrate arch/sparc/include/asm 2012-10-09 09:47:43 +01:00
ptrace.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
ross.h
rwsem.h rwsem: Move duplicate function prototypes to linux/rwsem.h 2011-01-27 12:30:39 +01:00
sbi.h
scratchpad.h
seccomp.h sparc: switch to using asm-generic for seccomp.h 2015-04-17 09:04:10 -04:00
sections.h sparc32: add support for run-time patching of leon/sun single instructions 2012-05-27 23:52:43 -07:00
setup.h sparc64: Migrate hvcons irq to panicked cpu 2017-10-21 17:09:05 +02:00
sfafsr.h
sfp-machine.h
sfp-machine_32.h sparc32: remove cast from output constraints in math asm statements 2014-05-18 19:01:28 -07:00
sfp-machine_64.h
shmparam.h
shmparam_32.h sparc32: Remove sun4 and sun4c from enum sparc_cpu. 2012-05-12 00:23:23 -07:00
shmparam_64.h
sigcontext.h UAPI: (Scripted) Disintegrate arch/sparc/include/asm 2012-10-09 09:47:43 +01:00
siginfo.h UAPI: (Scripted) Disintegrate arch/sparc/include/asm 2012-10-09 09:47:43 +01:00
signal.h consolidate kernel-side struct sigaction declarations 2013-02-03 15:09:22 -05:00
smp.h
smp_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
smp_64.h sparc64: fix sparse warnings in smp_64.c 2014-05-18 19:01:31 -07:00
sparsemem.h sparc64: Fix inconsistent max-physical-address defines. 2013-11-12 15:22:34 -08:00
spinlock.h
spinlock_32.h sparc32: unbreak arch_write_unlock() 2011-08-15 14:35:19 -07:00
spinlock_64.h sparc64: remove unnecessary macros from spinlock_64.h 2011-08-15 14:35:18 -07:00
spinlock_types.h
spitfire.h sparc64: correctly recognise M6 and M7 cpu type 2014-09-09 15:24:10 -07:00
stacktrace.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
starfire.h arch: sparc: kernel: starfire.c: Remove unused function 2015-03-01 21:33:58 -08:00
string.h
string_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
string_64.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
sunbpp.h
swift.h
switch_to.h Disintegrate asm/system.h for Sparc 2012-03-28 18:30:03 +01:00
switch_to_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
switch_to_64.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
syscall.h sparc: implement is_32bit_task 2014-09-23 16:21:27 -04:00
syscalls.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
termbits.h UAPI: (Scripted) Disintegrate arch/sparc/include/asm 2012-10-09 09:47:43 +01:00
termios.h UAPI: (Scripted) Disintegrate arch/sparc/include/asm 2012-10-09 09:47:43 +01:00
thread_info.h
thread_info_32.h sparc: Fix execution domain removal 2015-04-12 21:03:31 +02:00
thread_info_64.h sparc: Remove signal translation and exec_domain 2015-04-12 21:03:21 +02:00
timer.h
timer_32.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
timer_64.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
timex.h
timex_32.h sparc32: generic clockevent support 2012-04-15 10:28:50 -07:00
timex_64.h
tlb.h
tlb_32.h
tlb_64.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
tlbflush.h
tlbflush_32.h sparc32: Move cache and TLB flushes over to method ops. 2012-05-13 20:49:31 -07:00
tlbflush_64.h sparc64: Reduce TLB flushes during hugepte changes 2016-06-24 10:18:21 -07:00
topology.h
topology_32.h
topology_64.h sparc64: Fix numa distance values 2015-11-04 12:14:49 -08:00
trap_block.h sparc64: Measure receiver forward progress to avoid send mondo timeout 2017-08-11 09:08:56 -07:00
traps.h UAPI: (Scripted) Disintegrate arch/sparc/include/asm 2012-10-09 09:47:43 +01:00
tsb.h sparc64: Fix physical memory management regressions with large max_phys_bits. 2014-10-05 16:53:39 -07:00
tsunami.h
ttable.h sparc64: Fix return from trap window fill crashes. 2016-06-24 10:18:21 -07:00
turbosparc.h
uaccess.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00
uaccess_32.h sparc32: fix copy_from_user() 2016-09-24 10:07:45 +02:00
uaccess_64.h sparc64: Delete now unused user copy fixup functions. 2016-11-21 10:06:42 +01:00
unaligned.h
unistd.h sys_sgetmask/sys_ssetmask: add CONFIG_SGETMASK_SYSCALL 2014-06-04 16:54:14 -07:00
upa.h
user.h
vaddrs.h sparc32: drop fixmap.h 2012-07-26 16:46:16 -07:00
vga.h BUG: headers with BUG/BUG_ON etc. need linux/bug.h 2012-03-04 17:54:34 -05:00
viking.h
vio.h sparc: Machine description indices can vary 2017-06-14 13:16:20 +02:00
visasm.h sparc64: Fix userspace FPU register corruptions. 2015-08-06 19:13:25 -07:00
winmacro.h sparc32: Implement hard_smp_processor_id() via instruction patching. 2012-05-14 13:31:38 -07:00
xor.h
xor_32.h
xor_64.h sparc: drop use of extern for prototypes in arch/sparc/include/asm 2014-05-18 19:01:29 -07:00