From owner-svn-src-head@FreeBSD.ORG Fri Aug 9 23:13:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 073198E4; Fri, 9 Aug 2013 23:13:54 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE7A328CB; Fri, 9 Aug 2013 23:13:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r79NDrZN074421; Fri, 9 Aug 2013 23:13:53 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r79NDrJ0074418; Fri, 9 Aug 2013 23:13:53 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201308092313.r79NDrJ0074418@svn.freebsd.org> From: Olivier Houchard Date: Fri, 9 Aug 2013 23:13:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254167 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Aug 2013 23:13:54 -0000 Author: cognet Date: Fri Aug 9 23:13:52 2013 New Revision: 254167 URL: http://svnweb.freebsd.org/changeset/base/254167 Log: Don't call sleepinit() from proc0_init(), make it a SYSINIT instead. vmem needs the sleepq locks to be initialized when free'ing kva, so we want it called as early as possible. Modified: head/sys/kern/init_main.c head/sys/kern/kern_synch.c head/sys/sys/proc.h Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Aug 9 22:30:54 2013 (r254166) +++ head/sys/kern/init_main.c Fri Aug 9 23:13:52 2013 (r254167) @@ -455,10 +455,6 @@ proc0_init(void *dummy __unused) * Add scheduler specific parts to proc, thread as needed. */ schedinit(); /* scheduler gets its house in order */ - /* - * Initialize sleep queue hash table - */ - sleepinit(); /* * Create process 0 (the swapper). Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Fri Aug 9 22:30:54 2013 (r254166) +++ head/sys/kern/kern_synch.c Fri Aug 9 23:13:52 2013 (r254167) @@ -121,8 +121,8 @@ SDT_PROBE_DEFINE(sched, , , schedctl_nop SDT_PROBE_DEFINE(sched, , , schedctl_preempt, schedctl-preempt); SDT_PROBE_DEFINE(sched, , , schedctl_yield, schedctl-yield); -void -sleepinit(void) +static void +sleepinit(void *unused) { hogticks = (hz / 10) * 2; /* Default only. */ @@ -130,6 +130,12 @@ sleepinit(void) } /* + * vmem tries to lock the sleepq mutexes when free'ing kva, so make sure + * it is available. + */ +SYSINIT(sleepinit, SI_SUB_KMEM, SI_ORDER_ANY, sleepinit, 0); + +/* * General sleep call. Suspends the current thread until a wakeup is * performed on the specified identifier. The thread will then be made * runnable with the specified priority. Sleeps at most sbt units of time Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Aug 9 22:30:54 2013 (r254166) +++ head/sys/sys/proc.h Fri Aug 9 23:13:52 2013 (r254167) @@ -892,7 +892,6 @@ int setrunnable(struct thread *); void setsugid(struct proc *p); int should_yield(void); int sigonstack(size_t sp); -void sleepinit(void); void stopevent(struct proc *, u_int, u_int); struct thread *tdfind(lwpid_t, pid_t); void threadinit(void);