mm-memory-convert-details-even_cows-into-details-skip_cows.patch removed from -mm tree
The quilt patch titled
Subject: mm/memory: convert details->even_cows into details->skip_cows
has been removed from the -mm tree. Its filename was
mm-memory-convert-details-even_cows-into-details-skip_cows.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: "David Hildenbrand (Arm)" <[email protected]>
Subject: mm/memory: convert details->even_cows into details->skip_cows
Date: Fri, 27 Feb 2026 21:08:40 +0100
The current semantics are confusing: simply because someone specifies an empty zap_detail struct suddenly makes should_zap_cows() behave differently. The default should be to also zap CoW'ed anonymous pages.
Really only unmap_mapping_pages() and friends want to skip zapping of these anon folios.
So let's invert the meaning; turn the confusing "reclaim_pt" check that overrides other properties in should_zap_cows() into a safety check.
Note that the only caller that sets reclaim_pt=true is madvise_dontneed_single_vma(), which wants to zap any pages.
---
include/linux/mm.h | 2 +- mm/madvise.c | 1 - mm/memory.c | 12 ++++++------ 3 files changed, 7 insertions(+), 8 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-memory-convert-details-even_cows-into-details-skip_cows +1 -1
@@ -2767,7 +2767,7 @@ extern void pagefault_out_of_memory(void*/ struct zap_details {struct folio *single_folio;/* Locked folio to be unmapped */ -bool even_cows;/* Zap COWed private pages too? */ +bool skip_cows;/* Do not zap COWed private pages */ bool reclaim_pt;/* Need reclaim page tables? */ zap_flags_t zap_flags;/* Extra flags for zapping */ };
mm/madvise.c renamed from mm/madvise.c~mm-memory-convert-details-even_cows-into-details-skip_cows +0 -1
@@ -853,7 +853,6 @@ static long madvise_dontneed_single_vma(struct madvise_behavior_range *range = &madv_behavior->range;struct zap_details details = { .reclaim_pt = true, - .even_cows = true, }; zap_page_range_single_batched(
mm/memory.c renamed from mm/memory.c~mm-memory-convert-details-even_cows-into-details-skip_cows +6 -6
@@ -1554,11 +1554,13 @@ copy_page_range(struct vm_area_struct *dstatic inline bool should_zap_cows (struct zap_details *details) {/* By default, zap all pages */ -if (!details || details->reclaim_pt) +if (!details)return true; +VM_WARN_ON_ONCE (details->skip_cows && details->reclaim_pt); +/* Or, we zap COWed pages only if the caller wants to */ -return details->even_cows; +return !details->skip_cows; }/* Decides whether we should zap this folio with the folio pointer specified */
@@ -2149,8 +2151,6 @@ void unmap_vmas(struct mmu_gather *tlb,struct mmu_notifier_range range;struct zap_details details = { .zap_flags =ZAP_FLAG_DROP_MARKER |ZAP_FLAG_UNMAP , -/* Careful - we need to zap private pages too! */ - .even_cows = true, }; vma = unmap->first;
@@ -4282,7 +4282,7 @@ void unmap_mapping_folio(struct folio *f first_index = folio->index; last_index =folio_next_index (folio) -1 ; - details.even_cows = false; + details.skip_cows = true; details.single_folio = folio; details.zap_flags =ZAP_FLAG_DROP_MARKER ;
@@ -4312,7 +4312,7 @@ void unmap_mapping_pages(struct address_pgoff_t first_index = start;pgoff_t last_index = start + nr -1 ; - details.even_cows = even_cows; + details.skip_cows = !even_cows;if (last_index < first_index) last_index =ULONG_MAX ;
_
Patches currently in -mm which might be from [email protected] are