ksm: use a folio in try_to_merge_one_page()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 2 Oct 2024 15:25:27 +0000 (16:25 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 7 Nov 2024 04:11:08 +0000 (20:11 -0800)
commit9c0a1b99e3919f5fddeeaf96b36f86ccc5cc2a10
tree5c8b3ff1fefd266e89de7d860439b9fdfc38a469
parent12833a732346dcf4e3bde55d6556fedf90743656
ksm: use a folio in try_to_merge_one_page()

Patch series "Remove PageKsm()".

The KSM flag is almost always tested on the folio rather than on the page.
This series removes the final users of PageKsm() and makes the flag only

This patch (of 5):

It is safe to use a folio here because all callers took a refcount on this
page.  The one wrinkle is that we have to recalculate the value of folio
after splitting the page, since it has probably changed.  Replaces nine
calls to compound_head() with one.

Link: https://lkml.kernel.org/r/20241002152533.1350629-1-willy@infradead.org
Link: https://lkml.kernel.org/r/20241002152533.1350629-2-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Alex Shi <alexs@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/ksm.c