From owner-svn-src-stable-11@freebsd.org Fri Dec 23 00:38:44 2016 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE048C8B969; Fri, 23 Dec 2016 00:38:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E0941E17; Fri, 23 Dec 2016 00:38:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBN0ch2M029261; Fri, 23 Dec 2016 00:38:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBN0chRm029259; Fri, 23 Dec 2016 00:38:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612230038.uBN0chRm029259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 23 Dec 2016 00:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310436 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 00:38:45 -0000 Author: jhb Date: Fri Dec 23 00:38:43 2016 New Revision: 310436 URL: https://svnweb.freebsd.org/changeset/base/310436 Log: MFC 308948: Initialize 'ticks' earlier in boot after 'hz' is set. This avoids the time-warp after kthreads have started running and the required fixup to td_slptick and td_blktick in the EARLY_AP_STARTUP case. Now, 'ticks' is initialized before any kthreads are created or any context switches are performed. Modified: stable/11/sys/kern/kern_clock.c stable/11/sys/kern/subr_param.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_clock.c ============================================================================== --- stable/11/sys/kern/kern_clock.c Thu Dec 22 23:59:53 2016 (r310435) +++ stable/11/sys/kern/kern_clock.c Fri Dec 23 00:38:43 2016 (r310436) @@ -393,10 +393,6 @@ static void initclocks(dummy) void *dummy; { -#ifdef EARLY_AP_STARTUP - struct proc *p; - struct thread *td; -#endif register int i; /* @@ -416,40 +412,6 @@ initclocks(dummy) #ifdef SW_WATCHDOG EVENTHANDLER_REGISTER(watchdog_list, watchdog_config, NULL, 0); #endif - /* - * Arrange for ticks to wrap 10 minutes after boot to help catch - * sign problems sooner. - */ - ticks = INT_MAX - (hz * 10 * 60); - -#ifdef EARLY_AP_STARTUP - /* - * Fixup the tick counts in any blocked or sleeping threads to - * account for the jump above. - */ - sx_slock(&allproc_lock); - FOREACH_PROC_IN_SYSTEM(p) { - PROC_LOCK(p); - if (p->p_state == PRS_NEW) { - PROC_UNLOCK(p); - continue; - } - FOREACH_THREAD_IN_PROC(p, td) { - thread_lock(td); - if (TD_ON_LOCK(td)) { - MPASS(td->td_blktick == 0); - td->td_blktick = ticks; - } - if (TD_ON_SLEEPQ(td)) { - MPASS(td->td_slptick == 0); - td->td_slptick = ticks; - } - thread_unlock(td); - } - PROC_UNLOCK(p); - } - sx_sunlock(&allproc_lock); -#endif } /* Modified: stable/11/sys/kern/subr_param.c ============================================================================== --- stable/11/sys/kern/subr_param.c Thu Dec 22 23:59:53 2016 (r310435) +++ stable/11/sys/kern/subr_param.c Fri Dec 23 00:38:43 2016 (r310436) @@ -171,6 +171,12 @@ init_param1(void) tick_sbt = SBT_1S / hz; tick_bt = sbttobt(tick_sbt); + /* + * Arrange for ticks to wrap 10 minutes after boot to help catch + * sign problems sooner. + */ + ticks = INT_MAX - (hz * 10 * 60); + #ifdef VM_SWZONE_SIZE_MAX maxswzone = VM_SWZONE_SIZE_MAX; #endif