From: David Miller <davem@davemloft.net>
To: mike.kravetz@oracle.com
Cc: linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org,
akpm@linux-foundation.org, kirill.shutemov@linux.intel.com,
nitin.m.gupta@oracle.com
Subject: Re: [PATCH v2] sparc64 mm: Fix more TSB sizing issues
Date: Wed, 28 Sep 2016 11:30:18 -0400 (EDT) [thread overview]
Message-ID: <20160928.113018.46166819947237523.davem@davemloft.net> (raw)
In-Reply-To: <1472676499-6325-1-git-send-email-mike.kravetz@oracle.com>
From: Mike Kravetz <mike.kravetz@oracle.com>
Date: Wed, 31 Aug 2016 13:48:19 -0700
> 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>
Applied.
prev parent reply other threads:[~2016-09-28 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-31 20:48 Mike Kravetz
2016-09-28 15:30 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160928.113018.46166819947237523.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.kravetz@oracle.com \
--cc=nitin.m.gupta@oracle.com \
--cc=sparclinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®