Skip to contentSkip to conversation

sparc: tsb must be flushed before tlb

PATCH In review Dave Kleikamp 2 participants 2 messages Jun 18, 2013 – Jun 19, 2013 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc: tsb must be flushed before tlb

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.

---
 arch/sparc/mm/tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/mm/tlb.c +1 -1
index 83d89bc..37e7bc4 100644
@@ -85,8 +85,8 @@ static void tlb_batch_add_one(struct mm_struct *mm, unsigned long vaddr,
 	}
 
 	if (!tb->active) {
-		global_flush_tlb_page(mm, vaddr);
 		flush_tsb_user_page(mm, vaddr);
+		global_flush_tlb_page(mm, vaddr);
 		goto out;
 	}
 
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

From: Dave Kleikamp <[email protected]>
Date: Tue, 18 Jun 2013 09:05:36 -0500

Quoted 10 lines

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.

Applied and queued up for -stable, thanks.