From: "Hillf Danton" <hillf.zj@alibaba-inc.com>
To: "'Mike Kravetz'" <mike.kravetz@oracle.com>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Cc: "'Aneesh Kumar K . V'" <aneesh.kumar@linux.vnet.ibm.com>,
"'Naoya Horiguchi'" <n-horiguchi@ah.jp.nec.com>,
"'Michal Hocko'" <mhocko@suse.com>,
"'Kirill A . Shutemov'" <kirill.shutemov@linux.intel.com>,
"'Dave Hansen'" <dave.hansen@linux.intel.com>,
"'Jan Stancek'" <jstancek@redhat.com>, <stable@vger.kernel.org>,
"'Andrew Morton'" <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/1] mm/hugetlb: fix huge page reservation leak in private mapping error paths
Date: Wed, 02 Nov 2016 11:15:47 +0800 [thread overview]
Message-ID: <069501d234b7$68941380$39bc3a80$@alibaba-inc.com> (raw)
In-Reply-To: <b9fbc257-bd3b-80e3-ac34-56fe7f325ef0@oracle.com>
On Wednesday, November 02, 2016 12:37 AM Mike Kravetz wrote:
> On 10/19/2016 08:11 PM, Mike Kravetz wrote:
> > Error paths in hugetlb_cow() and hugetlb_no_page() may free a newly
> > allocated huge page. If a reservation was associated with the huge
> > page, alloc_huge_page() consumed the reservation while allocating.
> > When the newly allocated page is freed in free_huge_page(), it will
> > increment the global reservation count. However, the reservation entry
> > in the reserve map will remain. This is not an issue for shared
> > mappings as the entry in the reserve map indicates a reservation exists.
> > But, an entry in a private mapping reserve map indicates the reservation
> > was consumed and no longer exists. This results in an inconsistency
> > between the reserve map and the global reservation count. This 'leaks'
> > a reserved huge page.
> >
> > Create a new routine restore_reserve_on_error() to restore the reserve
> > entry in these specific error paths. This routine makes use of a new
> > function vma_add_reservation() which will add a reserve entry for a
> > specific address/page.
> >
> > In general, these error paths were rarely (if ever) taken on most
> > architectures. However, powerpc contained arch specific code that
> > that resulted in an extra fault and execution of these error paths
> > on all private mappings.
> >
> > Fixes: 67961f9db8c4 ("mm/hugetlb: fix huge page reserve accounting for private mappings)
> >
>
> Any additional comments on this?
>
> It does address a regression with private mappings that appears to only be
> visible on powerpc. Aneesh submitted a patch to workaround the issue on
> powerpc that is in mmotm/linux-next (71271479df7e/955f9aa468e0). Aneesh's
> patch makes the symptoms go away. This patch addresses root cause.
>
Both works are needed, thanks.
Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com>
next prev parent reply other threads:[~2016-11-02 3:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 3:11 [PATCH 0/1] " Mike Kravetz
2016-10-20 3:11 ` [PATCH 1/1] " Mike Kravetz
2016-10-23 11:34 ` Aneesh Kumar K.V
2016-10-23 11:36 ` Aneesh Kumar K.V
2016-10-24 20:40 ` Mike Kravetz
2016-11-01 16:37 ` Mike Kravetz
2016-11-02 3:15 ` Hillf Danton [this message]
2016-10-20 15:44 ` [PATCH 0/1] " Jan Stancek
2016-10-20 16:29 ` Mike Kravetz
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='069501d234b7$68941380$39bc3a80$@alibaba-inc.com' \
--to=hillf.zj@alibaba-inc.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=dave.hansen@linux.intel.com \
--cc=jstancek@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mike.kravetz@oracle.com \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=stable@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®