From owner-cvs-src-old@FreeBSD.ORG Thu Jan 27 21:21:17 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8FA5106566C for ; Thu, 27 Jan 2011 21:21:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A6A4F8FC0C for ; Thu, 27 Jan 2011 21:21:17 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p0RLLHJQ063811 for ; Thu, 27 Jan 2011 21:21:17 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p0RLLHFx063810 for cvs-src-old@freebsd.org; Thu, 27 Jan 2011 21:21:17 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <201101272121.p0RLLHFx063810@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Thu, 27 Jan 2011 21:21:09 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_7 Subject: cvs commit: src/sys/kern init_main.c kern_fork.c kern_kthread.c sched_4bsd.c sched_ule.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:21:17 -0000 jhb 2011-01-27 21:21:09 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/kern init_main.c kern_fork.c kern_kthread.c sched_4bsd.c sched_ule.c Log: SVN rev 217982 on 2011-01-27 21:21:09Z by jhb MFC 217078,217079: Various priority fixes for creating new threads: - Move sched_fork() later in fork() after the various sections of the new thread and proc have been copied and zeroed from the old thread and proc. Otherwise attempts to modify thread or process data in sched_fork() could be undone. - Don't copy td_{base,}_user_pri from the old thread to the new thread in sched_fork_thread() in ULE. This is already done courtesy the bcopy() of the thread copy region. - Always initialize the real priority (td_priority) of new threads to the new thread's base priority (td_base_pri) to avoid bogusly inheriting a borrowed priority from the parent thread. - Properly initialize the base priority (td_base_pri) of thread0 to PVM to match the desired priority in td_priority. Otherwise the first time thread0 used a borrowed priority it would drop down to PUSER instead of PVM. - Explicitly initialize the starting priority of new kprocs to PVM to avoid inheriting some random priority from thread0. Revision Changes Path 1.283.2.12 +1 -1 src/sys/kern/init_main.c 1.282.2.12 +7 -6 src/sys/kern/kern_fork.c 1.38.2.1 +5 -4 src/sys/kern/kern_kthread.c 1.106.2.12 +1 -0 src/sys/kern/sched_4bsd.c 1.214.2.18 +5 -3 src/sys/kern/sched_ule.c