[PATCH] s390: superflous flush_tlb_range calls.
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 02:43:37 +0000 (18:43 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 02:43:37 +0000 (18:43 -0800)
From: Martin Schwidefsky <schwidefsky@de.ibm.com>

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
mm/msync.c

index b7ecb9a..cd71b71 100644 (file)
@@ -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;
index 0cf9c36..5467df5 100644 (file)
@@ -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);