# Re: Page zapping and page table reclaim

- From: David Hildenbrand \<hidden\>
- Date: 2021-03-18 18:17:27 
- List: linux-mm
- Page: https://ratatoskr.run/linux-mm/2021/03/6507036
- Thread: https://ratatoskr.run/linux-mm/2021/03/6506902/t.md

```text
On 18.03.21 19:03, Rik van Riel wrote:
> On Thu, 2021-03-11 at 19:14 +0100, David Hildenbrand wrote:
>> Hi folks,
>>
>> I was wondering, is there any mechanism that reclaims basically
>> empty
>> page tables in a running process?
>
> Currently we have do_munmap -> unmap_region -> free_pgtables,
> which is hooked up only to sys_munmap.
>
> We don't seem to have an equivalent for the various MADV_
> options that lead to freed memory.
>

The other path I am interested in is doing an fallocate(FALLOC_FL_PUNCH_HOLE)/MADV_REMOVE on a shared file/mapping, resulting in the same situation AFAIKS.

-- 
Thanks,

David / dhildenb


```
