CVS: cvs.openbsd.org: src

To: source-changes_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org

Subject: CVS: cvs.openbsd.org: src

From: Artur Grabowski <art_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org>

Date: Wed, 4 Aug 2004 15:49:19 -0600 (MDT)

CVSROOT: /cvs
Module name: src
Changes by: art_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org 2004/08/04 15:49:19
Modified files:
sys/sys : resourcevar.h
sys/kern : kern_clock.c kern_exit.c kern_fork.c
Log message:
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.