Skip to contentSkip to conversation

mm-hugetlb-convert-hugetlbfs_pagecache_present-to-folios.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Feb 13, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/hugetlb: convert hugetlbfs_pagecache_present() to folios
has been removed from the -mm tree. Its filename was
mm-hugetlb-convert-hugetlbfs_pagecache_present-to-folios.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Sidhartha Kumar <[email protected]>
Subject: mm/hugetlb: convert hugetlbfs_pagecache_present() to folios
Date: Wed, 25 Jan 2023 09:05:31 -0800

Refactor hugetlbfs_pagecache_present() to avoid getting and dropping a refcount on a page. Use RCU and page_cache_next_miss() instead.

---

mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-convert-hugetlbfs_pagecache_present-to-folios +7 -9
@@ -5651,17 +5651,15 @@ out_release_old:
 static bool hugetlbfs_pagecache_present(struct hstate *h,
 			struct vm_area_struct *vma, unsigned long address)
 {
-	struct address_space *mapping;
-	pgoff_t idx;
-	struct page *page;
+	struct address_space *mapping = vma->vm_file->f_mapping;
+	pgoff_t idx = vma_hugecache_offset(h, vma, address);
+	bool present;
 
-	mapping = vma->vm_file->f_mapping;
-	idx = vma_hugecache_offset(h, vma, address);
+	rcu_read_lock();
+	present = page_cache_next_miss(mapping, idx, 1) != idx;
+	rcu_read_unlock();
 
-	page = find_get_page(mapping, idx);
-	if (page)
-		put_page(page);
-	return page != NULL;
+	return present;
 }
 
 int hugetlb_add_to_page_cache(struct page *page, struct address_space *mapping,

_

Patches currently in -mm which might be from [email protected] are