Skip to contentSkip to conversation

mm/mmu_gather: remove @delay_remap of __tlb_remove_page_size()

PATCH Applied Wei Yang 5 participants 6 messages Dec 31, 2025 – Jan 8

Subsystems (4)
lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 mm/mmu_gather: remove @delay_remap of __tlb_remove_page_size()

Functioin __tlb_remove_page_size() is only used in tlb_remove_page_size() with @delay_remap set to false and it is passed directly to __tlb_remove_folio_pages_size().

Remove @delay_remap of __tlb_remove_page_size() and call __tlb_remove_folio_pages_size() with false @delay_remap.

Cc "David Hildenbrand (Red Hat)" <[email protected]>
---
 arch/s390/include/asm/tlb.h | 6 ++----
 include/asm-generic/tlb.h   | 5 ++---
 mm/mmu_gather.c             | 5 ++---
 3 files changed, 6 insertions(+), 10 deletions(-)
arch/s390/include/asm/tlb.h +2 -4
index 1e50f6f1ad9d..0b7b4df94b24 100644
@@ -24,7 +24,7 @@
 
 static inline void tlb_flush(struct mmu_gather *tlb);
 static inline bool __tlb_remove_page_size(struct mmu_gather *tlb,
-		struct page *page, bool delay_rmap, int page_size);
+		struct page *page, int page_size);
 static inline bool __tlb_remove_folio_pages(struct mmu_gather *tlb,
 		struct page *page, unsigned int nr_pages, bool delay_rmap);
 
@@ -46,10 +46,8 @@ static inline bool __tlb_remove_folio_pages(struct mmu_gather *tlb,
  * s390 doesn't delay rmap removal.
  */
 static inline bool __tlb_remove_page_size(struct mmu_gather *tlb,
-		struct page *page, bool delay_rmap, int page_size)
+		struct page *page, int page_size)
 {
-	VM_WARN_ON_ONCE(delay_rmap);
-
 	free_folio_and_swap_cache(page_folio(page));
 	return false;
 }
include/asm-generic/tlb.h +2 -3
index 4d679d2a206b..3975f7d11553 100644
@@ -287,8 +287,7 @@ struct mmu_gather_batch {
  */
 #define MAX_GATHER_BATCH_COUNT	(10000UL/MAX_GATHER_BATCH)
 
-extern bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page,
-		bool delay_rmap, int page_size);
+extern bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page, int page_size);
 bool __tlb_remove_folio_pages(struct mmu_gather *tlb, struct page *page,
 		unsigned int nr_pages, bool delay_rmap);
 
@@ -510,7 +509,7 @@ static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb)
 static inline void tlb_remove_page_size(struct mmu_gather *tlb,
 					struct page *page, int page_size)
 {
-	if (__tlb_remove_page_size(tlb, page, false, page_size))
+	if (__tlb_remove_page_size(tlb, page, page_size))
 		tlb_flush_mmu(tlb);
 }
 
mm/mmu_gather.c +2 -3
index 7468ec388455..2faa23d7f8d4 100644
@@ -210,10 +210,9 @@ bool __tlb_remove_folio_pages(struct mmu_gather *tlb, struct page *page,
 					     PAGE_SIZE);
 }
 
-bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page,
-		bool delay_rmap, int page_size)
+bool __tlb_remove_page_size(struct mmu_gather *tlb, struct page *page, int page_size)
 {
-	return __tlb_remove_folio_pages_size(tlb, page, 1, delay_rmap, page_size);
+	return __tlb_remove_folio_pages_size(tlb, page, 1, false, page_size);
 }
 
 #endif /* MMU_GATHER_NO_GATHER */
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Wed, 31 Dec 2025 03:00:26 +0000 Wei Yang <[email protected]> wrote:

Functioin __tlb_remove_page_size() is only used in tlb_remove_page_size() with @delay_remap set to false and it is passed directly to __tlb_remove_folio_pages_size().

Remove @delay_remap of __tlb_remove_page_size() and call __tlb_remove_folio_pages_size() with false @delay_remap.

Makes sense to me.

Quoted 3 lines
Cc "David Hildenbrand (Red Hat)" <[email protected]>

Thanks,
SJ

[...]

Acked-by on v1 1/1
#2 lore raw
In reply to Wei Yang
Quoted 1 line · Wei Yang

Functioin __tlb_remove_page_size() is only used in

s/Functioin/Function/

Quoted 8 lines

tlb_remove_page_size() with @delay_remap set to false and it is passed directly to __tlb_remove_folio_pages_size().

Remove @delay_remap of __tlb_remove_page_size() and call __tlb_remove_folio_pages_size() with false @delay_remap.

Cc "David Hildenbrand (Red Hat)" <[email protected]>

Right, the only code that sets delay_rmap=true is zap_present_folio_ptes() where we now only call __tlb_remove_folio_pages() directly.

Signature · 3 lines
Cheers

David
author
#3 lore raw
Quoted 11 lines · David Hildenbrand (Red Hat)
Quoted 1 line · Wei Yang

Functioin __tlb_remove_page_size() is only used in

s/Functioin/Function/

Quoted 6 lines

tlb_remove_page_size() with @delay_remap set to false and it is passed directly to __tlb_remove_folio_pages_size().

Remove @delay_remap of __tlb_remove_page_size() and call __tlb_remove_folio_pages_size() with false @delay_remap.

Quoted 8 lines
Quoted 2 lines
Cc "David Hildenbrand (Red Hat)" <[email protected]>

Right, the only code that sets delay_rmap=true is zap_present_folio_ptes() where we now only call __tlb_remove_folio_pages() directly.

Thanks

Quoted 4 lines
Signature · 3 lines
Cheers

David
Signature · 2 lines
Wei Yang
Help you, Help me
maintainer Acked-by on v1 1/1
#4 lore raw
In reply to Wei Yang
Quoted 7 lines · Wei Yang

Functioin __tlb_remove_page_size() is only used in tlb_remove_page_size() with @delay_remap set to false and it is passed directly to __tlb_remove_folio_pages_size().

Remove @delay_remap of __tlb_remove_page_size() and call __tlb_remove_folio_pages_size() with false @delay_remap.

Quoted 7 lines
Cc "David Hildenbrand (Red Hat)" <[email protected]>
---
 arch/s390/include/asm/tlb.h | 6 ++----
 include/asm-generic/tlb.h   | 5 ++---
 mm/mmu_gather.c             | 5 ++---
 3 files changed, 6 insertions(+), 10 deletions(-)

Makes sense to me:

Will

maintainer Acked-by on v1 1/1
#5 lore raw
In reply to Wei Yang
Quoted 7 lines · Wei Yang

Functioin __tlb_remove_page_size() is only used in tlb_remove_page_size() with @delay_remap set to false and it is passed directly to __tlb_remove_folio_pages_size().

Remove @delay_remap of __tlb_remove_page_size() and call __tlb_remove_folio_pages_size() with false @delay_remap.

Quoted 7 lines
Cc "David Hildenbrand (Red Hat)" <[email protected]>
---
 arch/s390/include/asm/tlb.h | 6 ++----
 include/asm-generic/tlb.h   | 5 ++---
 mm/mmu_gather.c             | 5 ++---
 3 files changed, 6 insertions(+), 10 deletions(-)