patch-2.2.8 linux/arch/alpha/kernel/smp.c

Next file: linux/arch/alpha/kernel/traps.c
Previous file: linux/arch/alpha/kernel/process.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.7/linux/arch/alpha/kernel/smp.c linux/arch/alpha/kernel/smp.c
@@ -37,7 +37,18 @@
 #define DBGS(args)
 #endif
 
-struct ipi_msg_flush_tb_struct ipi_msg_flush_tb __cacheline_aligned;
+struct ipi_msg_flush_tb_struct {
+	volatile unsigned int flush_tb_mask;
+	union {
+		struct mm_struct *	flush_mm;
+		struct vm_area_struct *	flush_vma;
+	} p;
+	unsigned long flush_addr;
+	unsigned long flush_end;
+};
+
+static struct ipi_msg_flush_tb_struct ipi_msg_flush_tb __cacheline_aligned;
+static spinlock_t flush_tb_lock = SPIN_LOCK_UNLOCKED;
 
 struct cpuinfo_alpha cpu_data[NR_CPUS];
 
@@ -786,7 +797,7 @@
 	unsigned long to_whom = cpu_present_map ^ (1 << smp_processor_id());
 	long timeout = 1000000;
 
-	spin_lock_own(&kernel_flag, "flush_tlb_all");
+	spin_lock(&flush_tb_lock);
 
 	ipi_msg_flush_tb.flush_tb_mask = to_whom;
 	send_ipi_message(to_whom, IPI_TLB_ALL);
@@ -803,6 +814,8 @@
 		       ipi_msg_flush_tb.flush_tb_mask);
 		ipi_msg_flush_tb.flush_tb_mask = 0;
 	}
+
+	spin_unlock(&flush_tb_lock);
 }
 
 void
@@ -811,7 +824,7 @@
 	unsigned long to_whom = cpu_present_map ^ (1 << smp_processor_id());
 	long timeout = 1000000;
 
-	spin_lock_own(&kernel_flag, "flush_tlb_mm");
+	spin_lock(&flush_tb_lock);
 
 	ipi_msg_flush_tb.flush_tb_mask = to_whom;
 	ipi_msg_flush_tb.p.flush_mm = mm;
@@ -833,6 +846,8 @@
 		       ipi_msg_flush_tb.flush_tb_mask);
 		ipi_msg_flush_tb.flush_tb_mask = 0;
 	}
+
+	spin_unlock(&flush_tb_lock);
 }
 
 void
@@ -843,7 +858,7 @@
 	struct mm_struct * mm = vma->vm_mm;
 	int timeout = 1000000;
 
-	spin_lock_own(&kernel_flag, "flush_tlb_page");
+	spin_lock(&flush_tb_lock);
 
 	ipi_msg_flush_tb.flush_tb_mask = to_whom;
 	ipi_msg_flush_tb.p.flush_vma = vma;
@@ -866,6 +881,8 @@
 		       ipi_msg_flush_tb.flush_tb_mask);
 		ipi_msg_flush_tb.flush_tb_mask = 0;
 	}
+
+	spin_unlock(&flush_tb_lock);
 }
 
 void

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)