summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-02-17 10:03:02 +0000
committertjr <tjr@FreeBSD.org>2003-02-17 10:03:02 +0000
commit6ebeaa8ec8a84c0fe2ebf0392ae3386ba9840a81 (patch)
tree70379db9c789bdee37bcb55df1faf55a4e2e6708 /sys/compat/linux
parent5c29a640b86af6a1bd38d6186b82cba5e9c21065 (diff)
downloadFreeBSD-src-6ebeaa8ec8a84c0fe2ebf0392ae3386ba9840a81.zip
FreeBSD-src-6ebeaa8ec8a84c0fe2ebf0392ae3386ba9840a81.tar.gz
Use the proc lock to protect p_realtimer instead of Giant, and obtain
sched_lock around accesses to p_stats->p_timer[] to avoid a potential race with hardclock. getitimer(), setitimer() and the realitexpire() callout are now Giant-free.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_misc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 57460a8..b5057ec 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -164,7 +164,6 @@ linux_alarm(struct thread *td, struct linux_alarm_args *args)
{
struct itimerval it, old_it;
struct timeval tv;
- int s;
#ifdef DEBUG
if (ldebug(alarm))
@@ -178,7 +177,7 @@ linux_alarm(struct thread *td, struct linux_alarm_args *args)
it.it_value.tv_usec = 0;
it.it_interval.tv_sec = 0;
it.it_interval.tv_usec = 0;
- s = splsoftclock();
+ PROC_LOCK(td->td_proc);
old_it = td->td_proc->p_realtimer;
getmicrouptime(&tv);
if (timevalisset(&old_it.it_value))
@@ -189,7 +188,7 @@ linux_alarm(struct thread *td, struct linux_alarm_args *args)
timevaladd(&it.it_value, &tv);
}
td->td_proc->p_realtimer = it;
- splx(s);
+ PROC_UNLOCK(td->td_proc);
if (timevalcmp(&old_it.it_value, &tv, >)) {
timevalsub(&old_it.it_value, &tv);
if (old_it.it_value.tv_usec != 0)
OpenPOWER on IntegriCloud