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 -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 2004-01-12 01:44:19.000000000 -0800 +++ 25-akpm/mm/memory.c 2004-01-12 01:44:22.000000000 -0800 @@ -868,6 +868,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; @@ -949,6 +952,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 2004-01-12 01:44:19.000000000 -0800 +++ 25-akpm/mm/msync.c 2004-01-12 01:44:19.000000000 -0800 @@ -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); _