linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Miaohe Lin <linmiaohe@huawei.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: <linux-mm@kvack.org>, David Hildenbrand <david@redhat.com>,
	Oscar Salvador <osalvador@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] mm: Remove a call to compound_head() from is_page_hwpoison()
Date: Fri, 15 Mar 2024 14:38:36 +0800	[thread overview]
Message-ID: <f801e22f-b369-e5d1-ca46-ca28b4f97335@huawei.com> (raw)
In-Reply-To: <20240314012506.1600378-3-willy@infradead.org>

On 2024/3/14 9:25, Matthew Wilcox (Oracle) wrote:
> We can call it only once instead of twice.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>

Thanks.

> ---
>  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);
> 



      parent reply	other threads:[~2024-03-15  6:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14  1:25 [PATCH 0/2] Reliable testing for hugetlb Matthew Wilcox (Oracle)
2024-03-14  1:25 ` [PATCH 1/2] mm: Turn folio_test_hugetlb into a PageType Matthew Wilcox (Oracle)
2024-03-14 10:26   ` David Hildenbrand
2024-03-14 14:33     ` Matthew Wilcox
2024-03-15  6:19       ` Miaohe Lin
2024-03-15 12:32         ` Matthew Wilcox
2024-03-18  1:45           ` Miaohe Lin
2024-03-14  1:25 ` [PATCH 2/2] mm: Remove a call to compound_head() from is_page_hwpoison() Matthew Wilcox (Oracle)
2024-03-14 10:26   ` David Hildenbrand
2024-03-15  6:38   ` Miaohe Lin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f801e22f-b369-e5d1-ca46-ca28b4f97335@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox