On Wed, 17 Mar 2021 10:12:02 +0100
David Hildenbrand [off-list ref] wrote:
I wonder if a simple
if (PageHWPoison(compound_head(page)))
ret = 0;
won't suffice. But I guess the "issue" is compound pages that are not
huge pages or transparent huge pages.
Yes, the simple case won't suffice, as we mark the hugetlb page poison in head, and
other cases in the specific single page struct.
If not, we certainly want a wrapper for that magic, otherwise we have to
replicate the same logic all over the place.
quoted
+
return (ret == 1) ? page : NULL;
}
#endif /* CONFIG_ELF_CORE */
Yes, May other places meet the requirements as the coredump meets, it's better to make a
wrapper for this. But i am not familiar with the specific scenario, so this patch only cover
the coredump case.
I will post a v2 patch for this.
--
Thanks!
Aili Yao