Skip to content

Commit

Permalink
mm: mmu_gather: do not expose delayed_rmap flag
Browse files Browse the repository at this point in the history
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.

Link: https://lkml.kernel.org/r/Y3SWCu6NRaMQ5dbD@li-4a3a4a4c-28e5-11b2-a85c-a8d192c6f089.ibm.com
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Alexander Gordeev authored and akpm00 committed Nov 30, 2022
1 parent 5df397d commit f036c81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 3 additions & 0 deletions mm/mmu_gather.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,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];
Expand Down

0 comments on commit f036c81

Please sign in to comment.