Re: ksm: initialize rmap values directly and make them const
From: Matthew Wilcox
Date: Fri Feb 06 2026 - 10:29:25 EST
On Fri, Feb 06, 2026 at 03:22:54PM +0800, xu.xin16@xxxxxxxxxx wrote:
> make them const to make code more robust. Besides, since KSM folios are always
> order-0, so folio_nr_pages(KSM folio) is always 1, so the line:
>
> "pgoff_end = pgoff_start + folio_nr_pages(folio) - 1;"
>
> becomes directly:
>
> "pgoff_end = pgoff_start;"
How do you know KSM folios will always be order 0? I don't. NAK this
change.