linux-stable/arch/sparc
Mike Kravetz 1e953d846a sparc64 mm: Fix more TSB sizing issues
Commit af1b1a9b36 ("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>
2016-09-28 08:24:02 -07:00
..
boot sparc: Add "install" target 2014-08-04 20:45:59 -07:00
configs sparc/defconfigs: Remove CONFIG_IPV6_PRIVACY 2016-04-21 16:43:44 -04:00
crypto crypto: sparc - initialize blkcipher.ivsize 2015-10-08 21:36:48 +08:00
include sparc64 mm: Fix more TSB sizing issues 2016-09-28 08:24:02 -07:00
kernel sparc: support static_key usage in non-module __exit sections 2016-08-04 08:50:07 -04:00
lib locking/atomic, arch/sparc: Implement atomic{,64}_fetch_{add,sub,and,or,xor}() 2016-06-16 10:48:30 +02:00
math-emu arch/sparc/math-emu/math_32.c: drop stray break operator 2014-08-04 20:29:06 -07:00
mm sparc64 mm: Fix more TSB sizing issues 2016-09-28 08:24:02 -07:00
net sparc: Fix misspellings in comments. 2016-03-20 21:28:58 -07:00
oprofile
power Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2014-10-11 20:36:34 -04:00
prom sparc64: Fix register corruption in top-most kernel stack frame during boot. 2014-10-24 09:52:49 -07:00
Kbuild
Kconfig sparc/uaccess: Enable hardened usercopy 2016-07-26 14:41:52 -07:00
Kconfig.debug
Makefile sparc32: Add -Wa,-Av8 to KBUILD_CFLAGS. 2016-03-01 00:24:04 -05:00