From fc774e4e6187049f5664501ce29c12c5508931f4 Mon Sep 17 00:00:00 2001 From: yamt Date: Sat, 31 Jan 2009 15:53:36 +0000 Subject: [PATCH] settime1: fix a bug i introduced when i made l_stime use monotonic time. from Matthias Drochner on tech-kern@. PR/40511 from Martin Husemann. --- sys/kern/kern_time.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 68982a59001c..39b5d94842d8 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_time.c,v 1.158 2009/01/30 23:11:27 ad Exp $ */ +/* $NetBSD: kern_time.c,v 1.159 2009/01/31 15:53:36 yamt Exp $ */ /*- * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.158 2009/01/30 23:11:27 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.159 2009/01/31 15:53:36 yamt Exp $"); #include #include @@ -132,8 +132,6 @@ static int settime1(struct proc *p, const struct timespec *ts, bool check_kauth) { struct timespec delta, now; - struct bintime btdelta; - lwp_t *l; int s; /* WHAT DO WE DO ABOUT PENDING REAL-TIME TIMEOUTS??? */ @@ -159,19 +157,6 @@ settime1(struct proc *p, const struct timespec *ts, bool check_kauth) timespecadd(&boottime, &delta, &boottime); - /* - * XXXSMP: There is a short race between setting the time above - * and adjusting LWP's run times. Fixing this properly means - * pausing all CPUs while we adjust the clock. - */ - timespec2bintime(&delta, &btdelta); - mutex_enter(proc_lock); - LIST_FOREACH(l, &alllwp, l_list) { - lwp_lock(l); - bintime_add(&l->l_stime, &btdelta); - lwp_unlock(l); - } - mutex_exit(proc_lock); resettodr(); splx(s);