sparc: tsb must be flushed before tlb
authorDave Kleikamp <dave.kleikamp@oracle.com>
Tue, 18 Jun 2013 14:05:36 +0000 (09:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jul 2013 23:18:32 +0000 (16:18 -0700)
upstream commit 23a01138efe216f8084cfaa74b0b90dd4b097441

This fixes a race where a cpu may re-load a tlb from a stale tsb right
after it has been flushed by a remote function call.

I still see some instability when stressing the system with parallel
kernel builds while creating memory pressure by writing to
/proc/sys/vm/nr_hugepages, but this patch improves the stability
significantly.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Acked-by: Bob Picco <bob.picco@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sparc/mm/tlb.c

index afd021ed9418132bda6b77827be7f87f27e982c5..072f5530373e0fe050247831eeee5b74e04308ea 100644 (file)
@@ -115,8 +115,8 @@ no_cache_flush:
        }
 
        if (!tb->active) {
-               global_flush_tlb_page(mm, vaddr);
                flush_tsb_user_page(mm, vaddr);
+               global_flush_tlb_page(mm, vaddr);
                goto out;
        }