From 6fefc8fa247f1c42fe59b560bbbf5688c48ef94a Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 18 Jan 2004 18:43:37 -0800 Subject: [PATCH] [PATCH] s390: superflous flush_tlb_range calls. From: Martin Schwidefsky while searching for a s390 tlb flush problem I noticed some superflous tlb flushes. One in zeromap_page_range, one in remap_page_range, and another one in filemap_sync. The patch just adds comments but I think these three flush_tlb_range calls can be removed. --- mm/memory.c | 6 ++++++ mm/msync.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/mm/memory.c b/mm/memory.c index b7ecb9abf26b1..cd71b713adadc 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -863,6 +863,9 @@ int zeromap_page_range(struct vm_area_struct *vma, unsigned long address, unsign address = (address + PGDIR_SIZE) & PGDIR_MASK; dir++; } while (address && (address < end)); + /* + * Why flush? zeromap_pte_range has a BUG_ON for !pte_none() + */ flush_tlb_range(vma, beg, end); spin_unlock(&mm->page_table_lock); return error; @@ -944,6 +947,9 @@ int remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned lo from = (from + PGDIR_SIZE) & PGDIR_MASK; dir++; } while (from && (from < end)); + /* + * Why flush? remap_pte_range has a BUG_ON for !pte_none() + */ flush_tlb_range(vma, beg, end); spin_unlock(&mm->page_table_lock); return error; diff --git a/mm/msync.c b/mm/msync.c index 0cf9c3617be17..5467df544970a 100644 --- a/mm/msync.c +++ b/mm/msync.c @@ -113,6 +113,10 @@ static int filemap_sync(struct vm_area_struct * vma, unsigned long address, address = (address + PGDIR_SIZE) & PGDIR_MASK; dir++; } while (address && (address < end)); + /* + * Why flush ? filemap_sync_pte already flushed the tlbs with the + * dirty bits. + */ flush_tlb_range(vma, end - size, end); spin_unlock(&vma->vm_mm->page_table_lock); -- 2.53.0