Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21ae5b01 authored by Andrea Arcangeli's avatar Andrea Arcangeli Committed by Linus Torvalds
Browse files

thp: skip transhuge pages in ksm for now



Skip transhuge pages in ksm for now.

Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
Reviewed-by: default avatarRik van Riel <riel@redhat.com>
Acked-by: default avatarMel Gorman <mel@csn.ul.ie>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b15d00b6
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@ static struct page *get_mergeable_page(struct rmap_item *rmap_item)
	page = follow_page(vma, addr, FOLL_GET);
	if (IS_ERR_OR_NULL(page))
		goto out;
	if (PageAnon(page)) {
	if (PageAnon(page) && !PageTransCompound(page)) {
		flush_anon_page(vma, page, addr);
		flush_dcache_page(page);
	} else {
@@ -1279,7 +1279,19 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page)
			if (ksm_test_exit(mm))
				break;
			*page = follow_page(vma, ksm_scan.address, FOLL_GET);
			if (!IS_ERR_OR_NULL(*page) && PageAnon(*page)) {
			if (IS_ERR_OR_NULL(*page)) {
				ksm_scan.address += PAGE_SIZE;
				cond_resched();
				continue;
			}
			if (PageTransCompound(*page)) {
				put_page(*page);
				ksm_scan.address &= HPAGE_PMD_MASK;
				ksm_scan.address += HPAGE_PMD_SIZE;
				cond_resched();
				continue;
			}
			if (PageAnon(*page)) {
				flush_anon_page(vma, *page, ksm_scan.address);
				flush_dcache_page(*page);
				rmap_item = get_next_rmap_item(slot,
@@ -1293,7 +1305,6 @@ static struct rmap_item *scan_get_next_rmap_item(struct page **page)
				up_read(&mm->mmap_sem);
				return rmap_item;
			}
			if (!IS_ERR_OR_NULL(*page))
			put_page(*page);
			ksm_scan.address += PAGE_SIZE;
			cond_resched();