[PATCHv4 16/25] thp, mlock: do not mlock PTE-mapped file huge pages

2016-03-11 Thread Kirill A. Shutemov
As with anon THP, we only mlock file huge pages if we can prove that the page is not mapped with PTE. This way we can avoid mlock leak into non-mlocked vma on split. We rely on PageDoubleMap() under lock_page() to check if the the page may be PTE mapped. PG_double_map is set by

[PATCHv4 16/25] thp, mlock: do not mlock PTE-mapped file huge pages

2016-03-11 Thread Kirill A. Shutemov
As with anon THP, we only mlock file huge pages if we can prove that the page is not mapped with PTE. This way we can avoid mlock leak into non-mlocked vma on split. We rely on PageDoubleMap() under lock_page() to check if the the page may be PTE mapped. PG_double_map is set by