Re: [RFC PATCH 18/57] mm/collapse: install the destinations at PTE level

From: Kiryl Shutsemau

Date: Wed Aug 26 2026 - 13:06:31 EST


On Tue, Aug 25, 2026 at 02:48:51PM +0800, Lance Yang wrote:
>
> On Sun, Aug 16, 2026 at 11:45:30PM +0100, Kiryl Shutsemau wrote:
> >+ /* Slots with no source gain anon memory that no zap accounted */
> >+ if (nr_populated)
> >+ add_mm_counter(mm, MM_ANONPAGES, nr_populated);
>
> Well ... KSM zero-page accounting gets out of sync here.

True. Thanks for catching this!

> I was thinking of something like this:

Your code looks correct to me. I will take the collapse_abort_candidate()
hunk as is.

The install side I will organize slightly differently: a
collapse_account_install() that does the MM_ANONPAGES accounting in
addition to the KSM stuff, called from both install paths.

--
Kiryl Shutsemau / Kirill A. Shutemov