lkml.org 
[lkml]   [2022]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC 2/3] mm: changes to split_huge_page() to free zero filled tail pages
Date

> If you unmap something (resulting in pte_none()) where previously
> something used to be mapped in a page table, you might suddenly inform
> the user space fault handler about a page fault that it doesn't expect,
> because it previously placed a page and did not zap that page itself
> (MADV_DONTNEED).
>
> So at least with userfaultfd I think we have to be careful. Not sure if
> there are other corner cases (again, KSM behavior is interesting)
>
> --
> Thanks,
>
> David / dhildenb

We can implement it such that if userfaultfd is enabled on a VMA then instead of unmapping the zero page,
we will map to a read only zero page.

The original patch from Yu Zhao frees zero pages only on reclaim, I am not sure
it needs to be this restricted though. In use cases where immediately freeing
zero pages does not work we can dedupe similar to how KSM does it.

\
 
 \ /
  Last update: 2022-08-31 00:15    [W:0.054 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site