diff options
author | Mike Kravetz <mike.kravetz@oracle.com> | 2016-08-31 23:48:19 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-09-28 18:24:02 +0300 |
commit | 1e953d846ac015fbfcf09c857e8f893924cb629c (patch) | |
tree | d476520c50e49a4d19ec25816ec6486d1642b126 /arch/sparc/kernel/setup_64.c | |
parent | bdf2f59e64eb9cd9e9dd90f990a9577640470c8a (diff) | |
download | linux-1e953d846ac015fbfcf09c857e8f893924cb629c.tar.xz |
sparc64 mm: Fix more TSB sizing issues
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>
Diffstat (limited to 'arch/sparc/kernel/setup_64.c')
0 files changed, 0 insertions, 0 deletions