Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jan 2011 21:16:23 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/kern init_main.c kern_fork.c kern_kthread.c sched_4bsd.c sched_ule.c
Message-ID:  <201101272116.p0RLGf0Z063442@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

jhb         2011-01-27 21:16:23 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_8)
    sys/kern             init_main.c kern_fork.c kern_kthread.c 
                         sched_4bsd.c sched_ule.c 
  Log:
  SVN rev 217981 on 2011-01-27 21:16:23Z 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.303.2.8   +1 -1      src/sys/kern/init_main.c
  1.306.2.6   +7 -6      src/sys/kern/kern_fork.c
  1.47.2.6    +5 -4      src/sys/kern/kern_kthread.c
  1.131.2.9   +1 -0      src/sys/kern/sched_4bsd.c
  1.257.2.19  +5 -3      src/sys/kern/sched_ule.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101272116.p0RLGf0Z063442>