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. --- 25-akpm/mm/memory.c | 6 ++++++ 25-akpm/mm/msync.c | 4 ++++ 2 files changed, 10 insertions(+) diff -puN mm/memory.c~s390-15-superfluous-flush_tlb_range-calls mm/memory.c --- 25/mm/memory.c~s390-15-superfluous-flush_tlb_range-calls Thu Jan 8 14:11:44 2004 +++ 25-akpm/mm/memory.c Thu Jan 8 14:11:44 2004 @@ -880,6 +880,9 @@ int zeromap_page_range(struct vm_area_st 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; @@ -961,6 +964,9 @@ int remap_page_range(struct vm_area_stru 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 -puN mm/msync.c~s390-15-superfluous-flush_tlb_range-calls mm/msync.c --- 25/mm/msync.c~s390-15-superfluous-flush_tlb_range-calls Thu Jan 8 14:11:44 2004 +++ 25-akpm/mm/msync.c Thu Jan 8 14:11:44 2004 @@ -113,6 +113,10 @@ static int filemap_sync(struct vm_area_s 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); _