Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

userfault; expand folio use in mfill_atomic_install_pte()

Call page_folio() a little earlier so we can use folio_mapping()
instead of page_mapping(), saving a call to compound_head().

Link: https://lkml.kernel.org/r/20240423225552.4113447-6-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Eric Biggers <ebiggers@google.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
a568b412 e18a9faf

+2 -3
+2 -3
mm/userfaultfd.c
··· 180 180 pte_t _dst_pte, *dst_pte; 181 181 bool writable = dst_vma->vm_flags & VM_WRITE; 182 182 bool vm_shared = dst_vma->vm_flags & VM_SHARED; 183 - bool page_in_cache = page_mapping(page); 184 183 spinlock_t *ptl; 185 - struct folio *folio; 184 + struct folio *folio = page_folio(page); 185 + bool page_in_cache = folio_mapping(folio); 186 186 187 187 _dst_pte = mk_pte(page, dst_vma->vm_page_prot); 188 188 _dst_pte = pte_mkdirty(_dst_pte); ··· 212 212 if (!pte_none_mostly(ptep_get(dst_pte))) 213 213 goto out_unlock; 214 214 215 - folio = page_folio(page); 216 215 if (page_in_cache) { 217 216 /* Usually, cache pages are already added to LRU */ 218 217 if (newly_allocated)