VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Muchun Song <songmuchun@bytedance.com> 2021-09-07 19:55:55 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-09-08 11:50:23 -0700 commit: fe3df441ef885a75a3eff5e151ead1a92266d222 parent: 5ef5f810199f421cb6455aa018fb8f21151b4a16
Commit Summary:
mm: remove redundant compound_head() calling
Diffstat:
1 file changed, 4 insertions, 2 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index b9eb5c12f3fe..b2cebf35ffe7 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1230,11 +1230,13 @@ void page_add_file_rmap(struct page *page, bool compound)
 						nr_pages);
 	} else {
 		if (PageTransCompound(page) && page_mapping(page)) {
+			struct page *head = compound_head(page);
+
 			VM_WARN_ON_ONCE(!PageLocked(page));
 
-			SetPageDoubleMap(compound_head(page));
+			SetPageDoubleMap(head);
 			if (PageMlocked(page))
-				clear_page_mlock(compound_head(page));
+				clear_page_mlock(head);
 		}
 		if (!atomic_inc_and_test(&page->_mapcount))
 			goto out;