git: kernel - Add requires p->p_token locking and holds around f

看板DFBSD_commit作者時間14年前 (2011/12/28 02:04), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit de7ac1d675b7dd4a7e0108b0482570e5ec02afc1 Author: Matthew Dillon <dillon@apollo.backplane.com> Date: Wed Nov 30 17:24:11 2011 -0800 kernel - Add requires p->p_token locking and holds around fork()'s child proc * fork() and vfork() allocate a new process, p2, initialize, and add it to the allproc list as well as other lists. * These functions failed to acquire p2's token, p2 becomes visible to the rest of the system when it's added to the allproc list. Even though p2's state is set to SIDL, this is insufficient protection. Acquire the token prior to adding p2 to allproc and keep holding the token until after we have finished initializing p2. * We must also PHOLD()/PRELE() p2 around the start_forked_proc() call to prevent it from getting ripped out from under us (if it exits quickly and/or detaches itself from its parent). * Possibly fixes the random seg-faulting issue we've seen under very heavy fork/exec (parallel compile) loads on the 48-core monster. Summary of changes: sys/kern/kern_fork.c | 88 ++++++++++++++++++++++++++++++++----------------- 1 files changed, 57 insertions(+), 31 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/de7ac1d675b7dd4a7e0108b0482570e5ec02afc1 -- DragonFly BSD source repository
文章代碼(AID): #1E-WYovr (DFBSD_commit)