Re: [PATCH 2/2] mm: Remove a call to compound_head() from is_page_hwpoison()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14.03.24 02:25, Matthew Wilcox (Oracle) wrote:
We can call it only once instead of twice.

Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
  include/linux/page-flags.h | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 6ebb573c7195..f1d65a72b378 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -1017,9 +1017,12 @@ static inline bool PageHuge(struct page *page)
   */
  static inline bool is_page_hwpoison(struct page *page)
  {
+	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);

Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>

--
Cheers,

David / dhildenb





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux