From owner-svn-src-stable@freebsd.org Sat Dec 31 17:05:10 2016 Return-Path: Delivered-To: svn-src-stable@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 CAEE3C997F8; Sat, 31 Dec 2016 17:05:10 +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 9A479156B; Sat, 31 Dec 2016 17:05:10 +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 uBVH59Rh093721; Sat, 31 Dec 2016 17:05:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBVH59Nh093720; Sat, 31 Dec 2016 17:05:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612311705.uBVH59Nh093720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 31 Dec 2016 17:05:09 +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: r310981 - 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@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 17:05:10 -0000 Author: jhb Date: Sat Dec 31 17:05:09 2016 New Revision: 310981 URL: https://svnweb.freebsd.org/changeset/base/310981 Log: MFC 310336: Don't spin in pause() during early boot for kthreads other than thread0. pause() uses a spin loop to simulate a sleep during early boot. However, we only need this for thread0 to get far enough in the boot process to enable timers (at which point pause() can sleep). For other kthreads, sleeping in pause() is ok as the callout will be scheduled and will eventually fire once thread0 initializes timers. Modified: stable/11/sys/kern/kern_synch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_synch.c ============================================================================== --- stable/11/sys/kern/kern_synch.c Sat Dec 31 16:57:05 2016 (r310980) +++ stable/11/sys/kern/kern_synch.c Sat Dec 31 17:05:09 2016 (r310981) @@ -321,7 +321,8 @@ pause_sbt(const char *wmesg, sbintime_t if (sbt == 0) sbt = tick_sbt; - if (cold || kdb_active || SCHEDULER_STOPPED()) { + if ((cold && curthread == &thread0) || kdb_active || + SCHEDULER_STOPPED()) { /* * We delay one second at a time to avoid overflowing the * system specific DELAY() function(s):