From: David Hildenbrand <david@redhat.com>
To: Jane Chu <jane.chu@oracle.com>,
willy@infradead.org, peterx@redhat.com,
akpm@linux-foundation.org, linmiaohe@huawei.com,
kirill.shutemov@linux.intel.com, hughd@google.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm: make page_mapped_in_vma() hugetlb walk aware
Date: Wed, 26 Feb 2025 16:53:06 +0100 [thread overview]
Message-ID: <8dd155b4-cdf5-42b9-9865-862184339fc2@redhat.com> (raw)
In-Reply-To: <0e825585-3421-4fa9-8912-41b936f29fae@redhat.com>
On 26.02.25 16:49, David Hildenbrand wrote:
> On 24.02.25 22:14, Jane Chu wrote:
>> When a process consumes a UE in a page, the memory failure handler
>> attempts to collect information for a potential SIGBUS.
>> If the page is an anonymous page, page_mapped_in_vma(page, vma) is
>> invoked in order to
>> 1. retrieve the vaddr from the process' address space,
>> 2. verify that the vaddr is indeed mapped to the poisoned page,
>> where 'page' is the precise small page with UE.
>>
>> It's been observed that when injecting poison to a non-head subpage
>> of an anonymous hugetlb page, no SIGBUS show up; while injecting to
>> the head page produces a SIGBUS. The casue is that, though hugetlb_walk()
>> returns a valid pmd entry (on x86), but check_pte() detects mismatch
>> between the head page per the pmd and the input subpage. Thus the vaddr
>> is considered not mapped to the subpage and the process is not collected
>> for SIGBUS purpose. This is the calling stack
>> collect_procs_anon
>> page_mapped_in_vma
>> page_vma_mapped_walk
>> hugetlb_walk
>> huge_pte_lock
>> check_pte
>>
>
> Why can't we require callers to never pass in subpages of hugetlb pages,
> and sanity check that this is the case?
To be precise: in collect_procs_anon() pass the head page of the hugetlb
page, or in page_mapped_in_vma(), use the head page of the folio for
hugetlb folios.
hugetlb folios are always entirely mapped, adding logic to detect if
sub-pages are mapped doesn't make too much sense.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2025-02-26 15:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 21:14 Jane Chu
2025-02-25 6:49 ` Miaohe Lin
2025-02-25 19:56 ` jane.chu
2025-02-26 15:49 ` David Hildenbrand
2025-02-26 15:53 ` David Hildenbrand [this message]
2025-02-26 19:08 ` jane.chu
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=8dd155b4-cdf5-42b9-9865-862184339fc2@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=jane.chu@oracle.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=peterx@redhat.com \
--cc=willy@infradead.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