linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: naoya.horiguchi@nec.com, akpm@linux-foundation.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memory-failure: fix crash in split_huge_page_to_list from soft_offline_page
Date: Sun, 21 Jan 2024 02:00:51 +0000	[thread overview]
Message-ID: <Zax60-Qu14QFuDod@casper.infradead.org> (raw)
In-Reply-To: <20240120065729.3276395-1-linmiaohe@huawei.com>

On Sat, Jan 20, 2024 at 02:57:29PM +0800, Miaohe Lin wrote:
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 636280d04008..20058f7ac3e9 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1377,8 +1377,13 @@ void ClearPageHWPoisonTakenOff(struct page *page)
>   */
>  static inline bool HWPoisonHandlable(struct page *page, unsigned long flags)
>  {
> -	/* Soft offline could migrate non-LRU movable pages */
> -	if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page))
> +	/*
> +	 * Soft offline could migrate non-LRU movable pages.
> +	 * Note that page->mapping is overloaded with slab->slab_list or slabs
> +	 * fields which might make slab pages appear like non-LRU movable pages.
> +	 * So __PageMovable() has to be done after PageSlab() is checked.
> +	 */
> +	if ((flags & MF_SOFT_OFFLINE) && !PageSlab(page) && __PageMovable(page))
>  		return true;
>  
>  	return PageLRU(page) || is_free_buddy_page(page);

I think would make more sense as

+	if (PageSlab(page))
+		return false;

... and then leave the rest alone (including not touching the comment)


  reply	other threads:[~2024-01-21  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-20  6:57 Miaohe Lin
2024-01-21  2:00 ` Matthew Wilcox [this message]
2024-01-22 12:57   ` Miaohe Lin
2024-01-22 14:36     ` Matthew Wilcox
2024-01-23  8:06       ` Miaohe Lin

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=Zax60-Qu14QFuDod@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=naoya.horiguchi@nec.com \
    /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