mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
mm: page cache: store only head pages in i_pages
Transparent Huge Pages are currently stored in i_pages as pointers to consecutive subpages. This patch changes that to storing consecutive pointers to the head page in preparation for storing huge pages more efficiently in i_pages. Large parts of this are "inspired" by Kirill's patch https://lore.kernel.org/lkml/[email protected]/ [[email protected]: fix swapcache pages] Link: http://lkml.kernel.org/r/[email protected] [[email protected]: hugetlb stores pages in page cache differently] Link: http://lkml.kernel.org/r/20190404134553.vuvhgmghlkiw2hgl@kshutemo-mobl1 Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox <[email protected]> Acked-by: Jan Kara <[email protected]> Reviewed-by: Kirill Shutemov <[email protected]> Reviewed-and-tested-by: Song Liu <[email protected]> Tested-by: William Kucharski <[email protected]> Reviewed-by: William Kucharski <[email protected]> Tested-by: Qian Cai <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Song Liu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
cefdca0a86
commit
5fd4ca2d84
8 changed files with 86 additions and 103 deletions
|
|
@ -39,6 +39,7 @@ static void memfd_tag_pins(struct xa_state *xas)
|
|||
xas_for_each(xas, page, ULONG_MAX) {
|
||||
if (xa_is_value(page))
|
||||
continue;
|
||||
page = find_subpage(page, xas->xa_index);
|
||||
if (page_count(page) - page_mapcount(page) > 1)
|
||||
xas_set_mark(xas, MEMFD_TAG_PINNED);
|
||||
|
||||
|
|
@ -88,6 +89,7 @@ static int memfd_wait_for_pins(struct address_space *mapping)
|
|||
bool clear = true;
|
||||
if (xa_is_value(page))
|
||||
continue;
|
||||
page = find_subpage(page, xas.xa_index);
|
||||
if (page_count(page) - page_mapcount(page) != 1) {
|
||||
/*
|
||||
* On the last scan, we clean up all those tags
|
||||
|
|
|
|||
Loading…
Reference in a new issue