From: Muchun Song <muchun.song@linux.dev>
To: Liu Shixin <liushixin2@huawei.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Naoya Horiguchi <nao.horiguchi@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] mm/swapfile: skip HugeTLB pages for unuse_vma
Date: Tue, 15 Oct 2024 10:33:36 +0800 [thread overview]
Message-ID: <ED9675B2-C82C-45D0-861B-48828553F53D@linux.dev> (raw)
In-Reply-To: <20241015014521.570237-1-liushixin2@huawei.com>
> On Oct 15, 2024, at 09:45, Liu Shixin <liushixin2@huawei.com> wrote:
>
> I got a bad pud error and lost a 1GB HugeTLB when calling swapoff.
> The problem can be reproduced by the following steps:
>
> 1. Allocate an anonymous 1GB HugeTLB and some other anonymous memory.
> 2. Swapout the above anonymous memory.
> 3. run swapoff and we will get a bad pud error in kernel message:
>
> mm/pgtable-generic.c:42: bad pud 00000000743d215d(84000001400000e7)
>
> We can tell that pud_clear_bad is called by pud_none_or_clear_bad
> in unuse_pud_range() by ftrace. And therefore the HugeTLB pages will
> never be freed because we lost it from page table. We can skip
> HugeTLB pages for unuse_vma to fix it.
>
> Fixes: 0fe6e20b9c4c ("hugetlb, rmap: add reverse mapping for hugepage")
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Acked-by: Muchun Song <muchun.song@linux.dev>
Thanks.
prev parent reply other threads:[~2024-10-15 2:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-15 1:45 [PATCH] mm/swapfile: skip HugeTLB pages for unuse_vma Liu Shixin
2024-10-15 2:33 ` Muchun Song [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=ED9675B2-C82C-45D0-861B-48828553F53D@linux.dev \
--to=muchun.song@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liushixin2@huawei.com \
--cc=nao.horiguchi@gmail.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;
as well as URLs for NNTP newsgroup(s).