lkml.org 
[lkml]   [2024]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/12] mm/ksm: catch tail page abnormal in page_stable_node
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;
> }


\
 
 \ /
  Last update: 2024-05-27 15:53    [W:0.101 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site