Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jul 2016 11:54:24 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303388 - head/sys/kern
Message-ID:  <201607271154.u6RBsOqA092958@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Jul 27 11:54:24 2016
New Revision: 303388
URL: https://svnweb.freebsd.org/changeset/base/303388

Log:
  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

Modified:
  head/sys/kern/kern_time.c

Modified: head/sys/kern/kern_time.c
==============================================================================
--- head/sys/kern/kern_time.c	Wed Jul 27 11:49:41 2016	(r303387)
+++ head/sys/kern/kern_time.c	Wed Jul 27 11:54:24 2016	(r303388)
@@ -120,9 +120,7 @@ settime(struct thread *td, struct timeva
 	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 timeva
 				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 timeva
 
 	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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607271154.u6RBsOqA092958>