Skip to contentSkip to conversation

thp: file pages support for split_huge_page()

PATCH New [email protected] 1 participant 1 message Jul 26, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 100/126 thp: file pages support for split_huge_page()

From: "Kirill A. Shutemov" <[email protected]>
Subject: thp: file pages support for split_huge_page()

Basic scheme is the same as for anon THP.

Main differences:

- File pages are on radix-tree, so we have head->_count offset by HPAGE_PMD_NR. The count got distributed to small pages during split.

- mapping->tree_lock prevents non-lockless access to pages under split

    over radix-tree;

- Lockless access is prevented by setting the head->_count to 0 during

    split;

- After split, some pages can be beyond i_size. We drop them from radix-tree.

- We don't setup migration entries. Just unmap pages. It helps handling cases when i_size is in the middle of the page: no need handle unmap pages beyond i_size manually.

---

 mm/gup.c         |    2 
 mm/huge_memory.c |  160 ++++++++++++++++++++++++++++++++-------------
 2 files changed, 117 insertions(+), 45 deletions(-)
mm/gup.c renamed from mm/gup.c~thp-file-pages-support-for-split_huge_page +2 -0
diff -puN mm/gup.c~thp-file-pages-support-for-split_huge_page mm/gup.c
@@ -288,6 +288,8 @@ struct page *follow_page_mask(struct vm_
 			ret = split_huge_page(page);
 			unlock_page(page);
 			put_page(page);
+			if (pmd_none(*pmd))
+				return no_page_table(vma, flags);
 		}
 
 		return ret ? ERR_PTR(ret) :
mm/huge_memory.c renamed from mm/huge_memory.c~thp-file-pages-support-for-split_huge_page +115 -45

259 lines not on this page · raw message

_