Remove Giant from settime(), tc_setclock_mtx guards tc_windup() calls,

and there is no other issues with parallel settime().  Remove spl()
vestiges there as well.

Tested by:	pho (as part of the whole patch)
Reviewed by:	jhb (same)
Discussed wit:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D7302
This commit is contained in:
Konstantin Belousov 2016-07-27 11:54:24 +00:00
parent 5760b029ee
commit 1822421c0b

View File

@ -120,9 +120,7 @@ settime(struct thread *td, struct timeval *tv)
struct timeval delta, tv1, tv2;
static struct timeval maxtime, laststep;
struct timespec ts;
int s;
s = splclock();
microtime(&tv1);
delta = *tv;
timevalsub(&delta, &tv1);
@ -152,10 +150,8 @@ settime(struct thread *td, struct timeval *tv)
printf("Time adjustment clamped to -1 second\n");
}
} else {
if (tv1.tv_sec == laststep.tv_sec) {
splx(s);
if (tv1.tv_sec == laststep.tv_sec)
return (EPERM);
}
if (delta.tv_sec > 1) {
tv->tv_sec = tv1.tv_sec + 1;
printf("Time adjustment clamped to +1 second\n");
@ -166,10 +162,8 @@ settime(struct thread *td, struct timeval *tv)
ts.tv_sec = tv->tv_sec;
ts.tv_nsec = tv->tv_usec * 1000;
mtx_lock(&Giant);
tc_setclock(&ts);
resettodr();
mtx_unlock(&Giant);
return (0);
}