linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc: Replace flag check with PageHWPoison() in check_new_page_bad()
@ 2025-03-20  6:33 Ye Liu
  2025-03-20 15:41 ` Sidhartha Kumar
  2025-03-21  4:48 ` Anshuman Khandual
  0 siblings, 2 replies; 3+ messages in thread
From: Ye Liu @ 2025-03-20  6:33 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, Ye Liu

From: Ye Liu <liuye@kylinos.cn>

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.

Signed-off-by: Ye Liu <liuye@kylinos.cn>
---
 mm/page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index fe76fd237dd0..6ef54abebf51 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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);
-- 
2.25.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/page_alloc: Replace flag check with PageHWPoison() in check_new_page_bad()
  2025-03-20  6:33 [PATCH] mm/page_alloc: Replace flag check with PageHWPoison() in check_new_page_bad() Ye Liu
@ 2025-03-20 15:41 ` Sidhartha Kumar
  2025-03-21  4:48 ` Anshuman Khandual
  1 sibling, 0 replies; 3+ messages in thread
From: Sidhartha Kumar @ 2025-03-20 15:41 UTC (permalink / raw)
  To: Ye Liu, akpm; +Cc: linux-mm, linux-kernel, Ye Liu

On 3/20/25 2:33 AM, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.cn>
> 
> 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.
> 
> Signed-off-by: Ye Liu <liuye@kylinos.cn>
> ---
>   mm/page_alloc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index fe76fd237dd0..6ef54abebf51 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -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: Sidhartha Kumar <sidhartha.kumar@oracle.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/page_alloc: Replace flag check with PageHWPoison() in check_new_page_bad()
  2025-03-20  6:33 [PATCH] mm/page_alloc: Replace flag check with PageHWPoison() in check_new_page_bad() Ye Liu
  2025-03-20 15:41 ` Sidhartha Kumar
@ 2025-03-21  4:48 ` Anshuman Khandual
  1 sibling, 0 replies; 3+ messages in thread
From: Anshuman Khandual @ 2025-03-21  4:48 UTC (permalink / raw)
  To: Ye Liu, akpm; +Cc: linux-mm, linux-kernel, Ye Liu



On 3/20/25 12:03, Ye Liu wrote:
> From: Ye Liu <liuye@kylinos.cn>
> 
> 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.
> 
> Signed-off-by: Ye Liu <liuye@kylinos.cn>
> ---
>  mm/page_alloc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index fe76fd237dd0..6ef54abebf51 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -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: Anshuman Khandual <anshuman.khandual@arm.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-21  4:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-20  6:33 [PATCH] mm/page_alloc: Replace flag check with PageHWPoison() in check_new_page_bad() Ye Liu
2025-03-20 15:41 ` Sidhartha Kumar
2025-03-21  4:48 ` Anshuman Khandual

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox