Skip to contentSkip to conversation

mm/page_alloc: Replace flag check with PageHWPoison() in check_new_page_bad()

PATCH Applied Ye Liu 3 participants 3 messages Mar 20, 2025 – Mar 21, 2025

Subsystems (2)
lore
Share & tools
lore

Ye Liu

author
#0 lore raw

PATCH 1/1 mm/page_alloc: Replace flag check with PageHWPoison() in check_new_page_bad()

From: Ye Liu <[email protected]>

This patch replaces the direct check for the __PG_HWPOISON flag with the PageHWPoison() macro, improving code readability and maintaining consistency with other parts of the memory management code.

---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
index fe76fd237dd0..6ef54abebf51 100644
@@ -1427,7 +1427,7 @@ static __always_inline void page_del_and_expand(struct zone *zone,
 
 static void check_new_page_bad(struct page *page)
 {
-	if (unlikely(page->flags & __PG_HWPOISON)) {
+	if (unlikely(PageHWPoison(page))) {
 		/* Don't complain about hwpoisoned pages */
 		if (PageBuddy(page))
 			__ClearPageBuddy(page);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Ye Liu

From: Ye Liu <[email protected]>

This patch replaces the direct check for the __PG_HWPOISON flag with the PageHWPoison() macro, improving code readability and maintaining consistency with other parts of the memory management code.

---
  mm/page_alloc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +0 -0
index fe76fd237dd0..6ef54abebf51 100644

mm/page_alloc.c static __always_inline void page_del_and_expand(struct zone *zone, · line 1433

Quoted 8 lines
mm/page_alloc.c +1 -1
@@ -1427,7 +1427,7 @@ static __always_inline void page_del_and_expand(struct zone *zone,
 
  static void check_new_page_bad(struct page *page)
  {
-	if (unlikely(page->flags & __PG_HWPOISON)) {
+	if (unlikely(PageHWPoison(page))) {
  		/* Don't complain about hwpoisoned pages */
  		if (PageBuddy(page))
  			__ClearPageBuddy(page);
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ye Liu
Quoted 16 lines · Ye Liu

From: Ye Liu <[email protected]>

This patch replaces the direct check for the __PG_HWPOISON flag with the PageHWPoison() macro, improving code readability and maintaining consistency with other parts of the memory management code.

---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +0 -0
index fe76fd237dd0..6ef54abebf51 100644

mm/page_alloc.c static __always_inline void page_del_and_expand(struct zone *zone, · line 1433

Quoted 8 lines
mm/page_alloc.c +1 -1
@@ -1427,7 +1427,7 @@ static __always_inline void page_del_and_expand(struct zone *zone,
 
 static void check_new_page_bad(struct page *page)
 {
-	if (unlikely(page->flags & __PG_HWPOISON)) {
+	if (unlikely(PageHWPoison(page))) {
 		/* Don't complain about hwpoisoned pages */
 		if (PageBuddy(page))
 			__ClearPageBuddy(page);