From: "HORIGUCHI NAOYA(堀口 直也)" <naoya.horiguchi@nec.com>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <naoya.horiguchi@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@redhat.com>,
Mike Kravetz <mike.kravetz@oracle.com>,
Liu Shixin <liushixin2@huawei.com>,
Yang Shi <shy828301@gmail.com>,
Oscar Salvador <osalvador@suse.de>,
Muchun Song <songmuchun@bytedance.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Linux-MM <linux-mm@kvack.org>
Subject: Re: [PATCH v1 5/5] mm, hwpoison: enable memory error handling on 1GB hugepage
Date: Thu, 9 Jun 2022 08:45:57 +0000 [thread overview]
Message-ID: <20220609084556.GA1459006@hori.linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <5743855d-8f22-0d82-56c0-1ab61ad431b7@huawei.com>
On Wed, Jun 08, 2022 at 08:57:24PM +0800, Miaohe Lin wrote:
...
> >
> > I think that most of page table walker for user address space should first
> > check is_vm_hugetlb_page() and call hugetlb specific walking code for vma
> > with VM_HUGETLB.
> > copy_page_range() is a good example. It calls copy_hugetlb_page_range()
> > for vma with VM_HUGETLB and the function should support hwpoison entry.
> > But I feel that I need testing for confirmation.
>
> Sorry, I missed it should be called from hugetlb variants.
>
> >
> > And I'm not sure that all other are prepared for non-present pud-mapping,
> > so I'll need somehow code inspection and testing for each.
>
> I browsed the code again, there still might be some problematic code paths:
>
> 1.For follow_pud_mask, !pud_present will mostly reach follow_pmd_mask(). This can be
> called for hugetlb page. (Note gup_pud_range is fixed at 15494520b776 ("mm: fix gup_pud_range"))
>
> 2.Even for huge_pte_alloc, pud_offset will be called in pud_alloc. So pudp will be an invalid pointer.
> And it will be de-referenced later.
Yes, these paths need to support non-present pud entry, so I'll update/add
the patches. It seems that I did the similar work for pmd few years ago
(cbef8478bee5 ("mm/hugetlb: pmd_huge() returns true for non-present hugepage").
Thanks,
Naoya Horiguchi
next prev parent reply other threads:[~2022-06-09 8:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-02 5:06 [PATCH v1 0/5] mm, hwpoison: enable 1GB hugepage support Naoya Horiguchi
2022-06-02 5:06 ` [PATCH v1 1/5] mm, hwpoison, hugetlb: introduce SUBPAGE_INDEX_HWPOISON to save raw error page Naoya Horiguchi
2022-06-07 12:45 ` Miaohe Lin
2022-06-07 13:04 ` David Hildenbrand
2022-06-08 1:31 ` HORIGUCHI NAOYA(堀口 直也)
2022-06-08 9:19 ` David Hildenbrand
2022-06-02 5:06 ` [PATCH v1 2/5] mm,hwpoison: set PG_hwpoison for busy hugetlb pages Naoya Horiguchi
2022-06-07 12:50 ` Miaohe Lin
2022-06-02 5:06 ` [PATCH v1 3/5] mm, hwpoison: make __page_handle_poison returns int Naoya Horiguchi
2022-06-07 12:54 ` Miaohe Lin
2022-06-08 1:40 ` HORIGUCHI NAOYA(堀口 直也)
2022-06-02 5:06 ` [PATCH v1 4/5] mm, hwpoison: skip raw hwpoison page in freeing 1GB hugepage Naoya Horiguchi
2022-06-07 13:56 ` Miaohe Lin
2022-06-02 5:06 ` [PATCH v1 5/5] mm, hwpoison: enable memory error handling on " Naoya Horiguchi
2022-06-07 14:11 ` Miaohe Lin
2022-06-08 6:16 ` HORIGUCHI NAOYA(堀口 直也)
2022-06-08 12:57 ` Miaohe Lin
2022-06-09 8:45 ` HORIGUCHI NAOYA(堀口 直也) [this message]
2022-06-09 11:28 ` Miaohe Lin
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=20220609084556.GA1459006@hori.linux.bs1.fc.nec.co.jp \
--to=naoya.horiguchi@nec.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liushixin2@huawei.com \
--cc=mike.kravetz@oracle.com \
--cc=naoya.horiguchi@linux.dev \
--cc=osalvador@suse.de \
--cc=shy828301@gmail.com \
--cc=songmuchun@bytedance.com \
/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).