summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-02-01 20:42:18 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-02-01 20:42:18 +0000
commit3a114d3a3f35f887545426f819f4a133b67e8aa1 (patch)
tree3bcca1cf877ee70c89703395bc9f5f374c9d15ae
parente7eaa73928e8d701dda8576afeb84aedeb49afe2 (diff)
When doing signotify, check if we're notifying a process on another
cpu and if we do, send it an IPI that will force to get into the kernel and process the AST. This makes signals to processes on other CPUs to be actually delivered as soon as possible instead of some time in the future when some interupt happens. heavy testing by krw@, miod@ ok (in principle, since he doesn't do amd64)
-rw-r--r--sys/arch/amd64/amd64/machdep.c16
-rw-r--r--sys/arch/amd64/include/cpu.h8
2 files changed, 17 insertions, 7 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 867e86a4f9a..7c464b5a3a3 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.53 2007/01/15 23:19:05 jsg Exp $ */
+/* $OpenBSD: machdep.c,v 1.54 2007/02/01 20:42:17 art Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -844,6 +844,20 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval)
return (EJUSTRETURN);
}
+/*
+ * Notify the current process (p) that it has a signal pending,
+ * process as soon as possible.
+ */
+void
+signotify(struct proc *p)
+{
+ aston(p);
+#ifdef MULTIPROCESSOR
+ if (p->p_cpu != curcpu() && p->p_cpu != NULL)
+ x86_send_ipi(p->p_cpu, X86_IPI_NOP);
+#endif
+}
+
int waittime = -1;
struct pcb dumppcb;
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h
index cf4f6ced4a6..4c95f710946 100644
--- a/sys/arch/amd64/include/cpu.h
+++ b/sys/arch/amd64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.23 2006/12/24 20:30:35 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.24 2007/02/01 20:42:17 art Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
@@ -229,11 +229,7 @@ extern u_int32_t cpus_attached;
*/
#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, aston(p))
-/*
- * Notify the current process (p) that it has a signal pending,
- * process as soon as possible.
- */
-#define signotify(p) aston(p)
+void signotify(struct proc *);
/*
* We need a machine-independent name for this.