mm-provide-mapping_wrprotect_range-function.patch removed from -mm tree
The quilt patch titled
Subject: mm: provide mapping_wrprotect_range() function
has been removed from the -mm tree. Its filename was
mm-provide-mapping_wrprotect_range-function.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: Lorenzo Stoakes <[email protected]>
Subject: mm: provide mapping_wrprotect_range() function
Date: Sat, 8 Feb 2025 15:52:55 +0000
In the fb_defio video driver, page dirty state is used to determine when frame buffer pages have been changed, allowing for batched, deferred I/O to be performed for efficiency.
This implementation had only one means of doing so effectively - the use of the folio_mkclean() function.
However, this use of the function is inappropriate, as the fb_defio implementation allocates kernel memory to back the framebuffer, and then is forced to specified page->index, mapping fields in order to permit the folio_mkclean() rmap traversal to proceed correctly.
It is not correct to specify these fields on kernel-allocated memory, and moreover since these are not folios, page->index, mapping are deprecated fields, soon to be removed.
We therefore need to provide a means by which we can correctly traverse the reverse mapping and write-protect mappings for a page backing an address_space page cache object at a given offset.
This patch provides this - mapping_wrprotect_range() - which allows for this operation to be performed for a specified address_space, offset, PFN and size, without requiring a folio nor, of course, an inappropriate use of page->index, mapping.
With this provided, we can subsequently adjust the fb_defio implementation to make use of this function and avoid incorrect invocation of folio_mkclean() and more importantly, incorrect manipulation of page->index and mapping fields.
---
include/linux/rmap.h | 3 + mm/rmap.c | 74 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+)
include/linux/rmap.h renamed from include/linux/rmap.h~mm-provide-mapping_wrprotect_range-function +3 -0
@@ -738,6 +738,9 @@ unsigned long page_address_in_vma(const*/ int folio_mkclean (struct folio *); +int mapping_wrprotect_range (struct address_space *mapping,pgoff_t pgoff, +unsigned long pfn,unsigned long nr_pages); +int pfn_mkclean_range (unsigned long pfn,unsigned long nr_pages,pgoff_t pgoff,struct vm_area_struct *vma);
mm/rmap.c renamed from mm/rmap.c~mm-provide-mapping_wrprotect_range-function +74 -0
80 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
mm-mremap-correctly-handle-partial-mremap-of-vma-starting-at-0.patch mm-mremap-refactor-mremap-system-call-implementation.patch mm-mremap-introduce-and-use-vma_remap_struct-threaded-state.patch mm-mremap-initial-refactor-of-move_vma.patch mm-mremap-complete-refactor-of-move_vma.patch mm-mremap-refactor-move_page_tables-abstracting-state.patch mm-mremap-thread-state-through-move-page-table-operation.patch