]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
To facillitate an upcoming Linuxulator merging partially
authordchagin <dchagin@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 9 Jan 2016 14:08:10 +0000 (14:08 +0000)
committerdchagin <dchagin@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 9 Jan 2016 14:08:10 +0000 (14:08 +0000)
commit339a11635e946ce68433838eedd8353ae6115d3c
tree098f09b40a7709202e8662e68db796b52cf431ce
parent03e9dc56c1266f7931c082d4d97d55d720409a1f
To facillitate an upcoming Linuxulator merging partially
MFC r275121 (by kib). Only merge the syntax changes from r275121,
PROC_*LOCK() macros still lock the same proc spinlock.

The process spin lock currently has the following distinct uses:

- Threads lifetime cycle, in particular, counting of the threads in
  the process, and interlocking with process mutex and thread lock.
  The main reason of this is that turnstile locks are after thread
  locks, so you e.g. cannot unlock blockable mutex (think process
  mutex) while owning thread lock.

- Virtual and profiling itimers, since the timers activation is done
  from the clock interrupt context.  Replace the p_slock by p_itimmtx
  and PROC_ITIMLOCK().

- Profiling code (profil(2)), for similar reason.  Replace the p_slock
  by p_profmtx and PROC_PROFLOCK().

- Resource usage accounting.  Need for the spinlock there is subtle,
  my understanding is that spinlock blocks context switching for the
  current thread, which prevents td_runtime and similar fields from
  changing (updates are done at the mi_switch()).  Replace the p_slock
  by p_statmtx and PROC_STATLOCK().

Discussed with: kib

git-svn-id: svn://svn.freebsd.org/base/stable/10@293473 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
13 files changed:
sys/compat/linux/linux_misc.c
sys/compat/svr4/svr4_misc.c
sys/fs/procfs/procfs_status.c
sys/kern/init_main.c
sys/kern/kern_clock.c
sys/kern/kern_exit.c
sys/kern/kern_proc.c
sys/kern/kern_racct.c
sys/kern/kern_resource.c
sys/kern/kern_thread.c
sys/kern/kern_time.c
sys/kern/subr_prof.c
sys/sys/proc.h