mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
mm: remove a call to compound_head() from is_page_hwpoison()
We can call it only once instead of twice. Link: https://lkml.kernel.org/r/20240321142448.1645400-7-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Miaohe Lin <linmiaohe@huawei.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Muchun Song <muchun.song@linux.dev> Cc: Oscar Salvador <osalvador@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
85edc15a4c
commit
8682a7be36
@ -1065,11 +1065,14 @@ static inline bool PageHuge(const struct page *page)
|
||||
* best effort only and inherently racy: there is no way to synchronize with
|
||||
* failing hardware.
|
||||
*/
|
||||
static inline bool is_page_hwpoison(struct page *page)
|
||||
static inline bool is_page_hwpoison(const struct page *page)
|
||||
{
|
||||
const struct folio *folio;
|
||||
|
||||
if (PageHWPoison(page))
|
||||
return true;
|
||||
return PageHuge(page) && PageHWPoison(compound_head(page));
|
||||
folio = page_folio(page);
|
||||
return folio_test_hugetlb(folio) && PageHWPoison(&folio->page);
|
||||
}
|
||||
|
||||
extern bool is_free_buddy_page(struct page *page);
|
||||
|
Loading…
Reference in New Issue
Block a user