History

Merge tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache

Pull folio updates from Matthew Wilcox: - Rewrite how munlock works to massively reduce the contention on i_mmap_rwsem (Hugh Dickins): https://lore.kernel.org/linux-mm/8e4356d-9622-a7f0-b2c-f116b5f2efea@google.com/ - Sort out the page refcount mess for ZONE_DEVICE pages (Christoph Hellwig): https://lore.kernel.org/linux-mm/20220210072828.2930359-1-hch@lst.de/ - Convert GUP to use folios and make pincount available for order-1 pages. (Matthew Wilcox) - Convert a few more truncation functions to use folios (Matthew Wilcox) - Convert page_vma_mapped_walk to use PFNs instead of pages (Matthew Wilcox) - Convert rmap_walk to use folios (Matthew Wilcox) - Convert most of shrink_page_list() to use a folio (Matthew Wilcox) - Add support for creating large folios in readahead (Matthew Wilcox) * tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache: (114 commits) mm/damon: minor cleanup for damon_pa_young selftests/vm/transhuge-stress: Support file-backed PMD folios mm/filemap: Support VM_HUGEPAGE for file mappings mm/readahead: Switch to page_cache_ra_order mm/readahead: Align file mappings for non-DAX mm/readahead: Add large folio readahead mm: Support arbitrary THP sizes mm: Make large folios depend on THP mm: Fix READ_ONLY_THP warning mm/filemap: Allow large folios to be added to the page cache mm: Turn can_split_huge_page() into can_split_folio() mm/vmscan: Convert pageout() to take a folio mm/vmscan: Turn page_check_references() into folio_check_references() mm/vmscan: Account large folios correctly mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios mm/vmscan: Free non-shmem folios without splitting them mm/rmap: Constify the rmap_walk_control argument mm/rmap: Convert rmap_walk() to take a folio mm: Turn page_anon_vma() into folio_anon_vma() mm/rmap: Turn page_lock_anon_vma_read() into folio_lock_anon_vma_read() ...

Linus Torvalds committed 4 years ago

Commit 9030fb02 parents 3bf03b9 2a3c4bc100 files · +2900 −3020Browse files

Showing the changes to kernel (2 of 100 files). Show all

Unified · Split

2 files
  1. kernel/events/uprobes.c +3 −10
  2. kernel/futex/core.c +1 −1
kernel/events/uprobes.c+3−10
@@ -155,11 +155,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr, · 154 unmodified lines
155155 struct page *old_page, struct page *new_page)
156156 {
157157 struct mm_struct *mm = vma->vm_mm;
158− struct page_vma_mapped_walk pvmw = {
159− .page = compound_head(old_page),
160− .vma = vma,
161− .address = addr,
162− };
158+ DEFINE_FOLIO_VMA_WALK(pvmw, page_folio(old_page), vma, addr, 0);
163159 int err;
164160 struct mmu_notifier_range range;
165161
@@ -173,7 +169,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr, · 7 unmodified lines
173169 return err;
174170 }
175171
176− /* For try_to_free_swap() and munlock_vma_page() below */
172+ /* For try_to_free_swap() below */
177173 lock_page(old_page);
178174
179175 mmu_notifier_invalidate_range_start(&range);
@@ -201,13 +197,10 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr, · 21 unmodified lines
201197 set_pte_at_notify(mm, addr, pvmw.pte,
202198 mk_pte(new_page, vma->vm_page_prot));
203199
204− page_remove_rmap(old_page, false);
200+ page_remove_rmap(old_page, vma, false);
205201 if (!page_mapped(old_page))
206202 try_to_free_swap(old_page);
207203 page_vma_mapped_walk_done(&pvmw);
208−
209− if ((vma->vm_flags & VM_LOCKED) && !PageCompound(old_page))
210− munlock_vma_page(old_page);
211204 put_page(old_page);
212205
213206 err = 0;
kernel/futex/core.c+1−1
@@ -302,7 +302,7 @@ again: · 301 unmodified lines
302302 * found it, but truncated or holepunched or subjected to
303303 * invalidate_complete_page2 before we got the page lock (also
304304 * cases which we are happy to fail). And we hold a reference,
305− * so refcount care in invalidate_complete_page's remove_mapping
305+ * so refcount care in invalidate_inode_page's remove_mapping
306306 * prevents drop_caches from setting mapping to NULL beneath us.
307307 *
308308 * The case we do have to guard against is when memory pressure made