# Re: \[RFC PATCH 01/57\] mm: add pte\_folio()

- From: Rik van Riel \<riel@surriel.com\>
- Date: 2026-08-18 17:10:59 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2026/08/17430189
- Thread: https://ratatoskr.run/linux-mm/2026/08/17419184/t.md

```text
On Sun, 2026-08-16 at 23:45 +0100, Kiryl Shutsemau wrote:
> From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
> 
> Callers that want the folio behind a present PTE spell it out as
> page_folio(pte_page(pte)).
> 
> Add pte_folio() as the folio companion to pte_page(), and convert the
> callers in fs/proc/task_mmu.c and mm/hugetlb.c.
> 
> Preparation for the anonymous collapse engine, which reads the folio
> behind a PTE in several places.
> 
> Assisted-by: Claude-Code:claude-opus-5
> Signed-off-by: Kiryl Shutsemau (Meta) <kas@kernel.org>

Oh nice, this could clean up some things in the
get_user_pages code too, when we get around to
tech debt there.

This could probably go in by itself.

Reviewed-by: Rik van Riel <riel@surriel.com>


-- 
All Rights Reversed.
```
