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);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to