summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2004-08-04 21:49:20 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2004-08-04 21:49:20 +0000
commitccf71ee5bcc792c009b8dbf0c51f6c02bca9a059 (patch)
tree0391d54fe59e6c1c51369cf7cd71a5a800461e82 /sys/kern/kern_exit.c
parentef68052c976c827bdfedb0eefb04cce7a37af7a7 (diff)
hardclock detects if ITIMER_VIRTUAL and ITIMER_PROF have expired and
sends SIGVTALRM and SIGPROF to the process if they had. There is a big problem with calling psignal from hardclock on MULTIPROCESSOR machines though. It means we need to protect all signal state in the process with a lock because hardclock doesn't obtain KERNEL_LOCK. Trying to track down all the tentacles of this quickly becomes very messy. What saves us at the moment is that SCHED_LOCK (which is used to protect parts of the signal state, but not all) happens to be recursive and forgives small and big errors. That's about to change. So instead of trying to hunt down all the locking problems here, just make hardclock not send signals. Instead hardclock schedules a timeout that will send the signal later. There are many reasons why this works just as good as the previous code, all explained in a comment written in big, friendly letters in kern_clock. miod@ ok noone else dared to ok this, but noone screamed in agony either.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 53bb4326ad8..a57f4c3db60 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exit.c,v 1.52 2004/07/22 15:42:11 art Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.53 2004/08/04 21:49:19 art Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
@@ -128,6 +128,8 @@ exit1(p, rv)
p->p_sigignore = ~0;
p->p_siglist = 0;
timeout_del(&p->p_realit_to);
+ timeout_del(&p->p_stats->p_virt_to);
+ timeout_del(&p->p_stats->p_prof_to);
/*
* Close open files and release open-file table.