[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3SWCu6NRaMQ5dbD@li-4a3a4a4c-28e5-11b2-a85c-a8d192c6f089.ibm.com>
Date: Wed, 16 Nov 2022 08:49:30 +0100
From: Alexander Gordeev <agordeev@...ux.ibm.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Hugh Dickins <hughd@...gle.com>,
Johannes Weiner <hannes@...xchg.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Nadav Amit <nadav.amit@...il.com>,
Will Deacon <will@...nel.org>,
Aneesh Kumar <aneesh.kumar@...ux.ibm.com>,
Nick Piggin <npiggin@...il.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Peter Zijlstra <peterz@...radead.org>,
Gerald Schaefer <gerald.schaefer@...ux.ibm.com>
Subject: mm: mmu_gather: do not expose delayed_rmap flag
Flag delayed_rmap of 'struct mmu_gather' is rather
a private member, but it is still accessed directly.
Instead, let the TLB gather code access the flag.
Signed-off-by: Alexander Gordeev <agordeev@...ux.ibm.com>
---
mm/memory.c | 3 +--
mm/mmu_gather.c | 3 +++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 42f10cc1de58..38b58cd07b52 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1465,8 +1465,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb,
/* Do the actual TLB flush before dropping ptl */
if (force_flush) {
tlb_flush_mmu_tlbonly(tlb);
- if (tlb->delayed_rmap)
- tlb_flush_rmaps(tlb, vma);
+ tlb_flush_rmaps(tlb, vma);
}
pte_unmap_unlock(start_pte, ptl);
diff --git a/mm/mmu_gather.c b/mm/mmu_gather.c
index 79de59136cd2..9f22309affee 100644
--- a/mm/mmu_gather.c
+++ b/mm/mmu_gather.c
@@ -60,6 +60,9 @@ void tlb_flush_rmaps(struct mmu_gather *tlb, struct vm_area_struct *vma)
{
struct mmu_gather_batch *batch;
+ if (!tlb->delayed_rmap)
+ return;
+
batch = tlb->active;
for (int i = 0; i < batch->nr; i++) {
struct encoded_page *enc = batch->encoded_pages[i];
--
2.31.1
Powered by blists - more mailing lists