linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: alexs@kernel.org
Cc: kasong@tencent.com, Andrew Morton <akpm@linux-foundation.org>,
	"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 01/12] mm/ksm: catch tail page abnormal in page_stable_node
Date: Mon, 18 Mar 2024 13:14:44 +0000	[thread overview]
Message-ID: <Zfg-RJU8z_HYArt5@casper.infradead.org> (raw)
In-Reply-To: <20240318121443.3991104-1-alexs@kernel.org>

On Mon, Mar 18, 2024 at 08:14:30PM +0800, alexs@kernel.org wrote:
> From: Alex Shi <alexs@kernel.org>
> 
> commit 19138349ed59 ("mm/migrate: Add folio_migrate_flags()") change the
> meaning of func page_stable_node() to check the compound head for tail
> 'page' instead of tail page self.
> But seems both semantics are same at results, the func always return NULL
>  for tail page. So adding a bug monitor here in case of abnormal.

No.  I didn't object to you doing this to convince yourself, but there's
no way we should have this upstream.

If we did have large KSM folios (and I don't think we should!), you'd
crash the kernel instead of silently doing the right thing.

>  static inline struct ksm_stable_node *page_stable_node(struct page *page)
>  {
> -	return folio_stable_node(page_folio(page));
> +	struct ksm_stable_node *node;
> +
> +	node = folio_stable_node(page_folio(page));
> +	VM_BUG_ON_PAGE(PageTail(page) && node, page);
> +
> +	return node;
>  }



      parent reply	other threads:[~2024-03-18 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 12:14 [PATCH 01/12] mm/ksm: catch tail page abnormal in page_stable_node alexs
2024-03-18 12:25 ` David Hildenbrand
2024-03-20  9:05   ` Alex Shi
2024-03-20  9:29     ` David Hildenbrand
2024-03-20 12:03       ` Alex Shi
2024-03-18 13:14 ` Matthew Wilcox [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=Zfg-RJU8z_HYArt5@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexs@kernel.org \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).