Re: [PATCH 2/3] proc: kpagecount: use snapshot_page()

From: Luiz Capitulino
Date: Wed Jul 02 2025 - 13:39:10 EST


On 2025-07-02 02:25, Shivank Garg wrote:


On 6/26/2025 11:46 PM, Luiz Capitulino wrote:
Currently, the call to folio_precise_page_mapcount() from kpage_read()
can race with a folio split. When the race happens we trigger a
VM_BUG_ON_FOLIO() in folio_entire_mapcount() (see splat below).

This commit fixes this race by using snapshot_page() so that we
retreive the folio mapcount using a folio snapshot.

s/retreive/retrieve/
checkpatch.pl would have flagged this.

Thanks for pointing this out. I do run checkpatch.pl before sending patches,
I don't know how I missed this.


Rest looks good to me.

Thanks,
Shivank