patch-2.4.0-test3 linux/arch/sparc64/kernel/smp.c

Next file: linux/arch/sparc64/kernel/sparc64_ksyms.c
Previous file: linux/arch/sparc64/kernel/signal32.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/arch/sparc64/kernel/smp.c linux/arch/sparc64/kernel/smp.c
@@ -386,6 +386,46 @@
 	}
 }
 
+struct call_data_struct {
+	void (*func) (void *info);
+	void *info;
+	atomic_t finished;
+	int wait;
+};
+
+extern unsigned long xcall_call_function;
+
+int smp_call_function(void (*func)(void *info), void *info,
+		      int nonatomic, int wait)
+{
+	struct call_data_struct data;
+	int cpus = smp_num_cpus - 1;
+
+	if (!cpus)
+		return 0;
+
+	data.func = func;
+	data.info = info;
+	atomic_set(&data.finished, 0);
+	data.wait = wait;
+
+	smp_cross_call(&xcall_call_function,
+		       0, (u64) &data, 0);
+	if (wait) {
+		while (atomic_read(&data.finished) != cpus)
+			barrier();
+	}
+
+	return 0;
+}
+
+void smp_call_function_client(struct call_data_struct *call_data)
+{
+	call_data->func(call_data->info);
+	if (call_data->wait)
+		atomic_inc(&call_data->finished);
+}
+
 extern unsigned long xcall_flush_tlb_page;
 extern unsigned long xcall_flush_tlb_mm;
 extern unsigned long xcall_flush_tlb_range;
@@ -677,7 +717,7 @@
 				}
 
 				if (user) {
-					if (current->priority < DEF_PRIORITY) {
+					if (current->nice > 0) {
 						inc = &kstat.cpu_nice;
 						inc2 = &kstat.per_cpu_nice[cpu];
 					} else {

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