From owner-svn-src-all@FreeBSD.ORG Sat May 26 20:03:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0B7A1065687; Sat, 26 May 2012 20:03:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBEF38FC12; Sat, 26 May 2012 20:03:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4QK3mNK003655; Sat, 26 May 2012 20:03:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4QK3mQj003650; Sat, 26 May 2012 20:03:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201205262003.q4QK3mQj003650@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 26 May 2012 20:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236117 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2012 20:03:49 -0000 Author: kib Date: Sat May 26 20:03:47 2012 New Revision: 236117 URL: http://svn.freebsd.org/changeset/base/236117 Log: Stop treating td_sigmask specially for the purposes of new thread creation. Move it into the copied region of the struct thread. Update some comments. Requested by: bde X-MFC after: never Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_kthread.c head/sys/kern/kern_thr.c head/sys/sys/proc.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat May 26 18:20:30 2012 (r236116) +++ head/sys/kern/kern_fork.c Sat May 26 20:03:47 2012 (r236117) @@ -475,7 +475,6 @@ do_fork(struct thread *td, int flags, st bcopy(&p2->p_comm, &td2->td_name, sizeof(td2->td_name)); td2->td_sigstk = td->td_sigstk; - td2->td_sigmask = td->td_sigmask; td2->td_flags = TDF_INMEM; td2->td_lend_user_pri = PRI_MAX; Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Sat May 26 18:20:30 2012 (r236116) +++ head/sys/kern/kern_kthread.c Sat May 26 20:03:47 2012 (r236117) @@ -271,7 +271,6 @@ kthread_add(void (*func)(void *), void * bzero(&newtd->td_startzero, __rangeof(struct thread, td_startzero, td_endzero)); -/* XXX check if we should zero. */ bcopy(&oldtd->td_startcopy, &newtd->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); @@ -295,7 +294,6 @@ kthread_add(void (*func)(void *), void * /* this code almost the same as create_thread() in kern_thr.c */ PROC_LOCK(p); p->p_flag |= P_HADTHREADS; - newtd->td_sigmask = oldtd->td_sigmask; /* XXX dubious */ thread_link(newtd, p); thread_lock(oldtd); /* let the scheduler know about these things. */ Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Sat May 26 18:20:30 2012 (r236116) +++ head/sys/kern/kern_thr.c Sat May 26 20:03:47 2012 (r236117) @@ -252,7 +252,6 @@ create_thread(struct thread *td, mcontex PROC_LOCK(td->td_proc); td->td_proc->p_flag |= P_HADTHREADS; - newtd->td_sigmask = td->td_sigmask; thread_link(newtd, p); bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name)); thread_lock(td); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat May 26 18:20:30 2012 (r236116) +++ head/sys/sys/proc.h Sat May 26 20:03:47 2012 (r236117) @@ -258,7 +258,6 @@ struct thread { u_int td_uticks; /* (t) Statclock hits in user mode. */ int td_intrval; /* (t) Return value for sleepq. */ sigset_t td_oldsigmask; /* (k) Saved mask from pre sigpause. */ - sigset_t td_sigmask; /* (c) Current signal mask. */ volatile u_int td_generation; /* (k) For detection of preemption */ stack_t td_sigstk; /* (k) Stack ptr and on-stack flag. */ int td_xsig; /* (c) Signal for ptrace */ @@ -272,10 +271,11 @@ struct thread { struct osd td_osd; /* (k) Object specific data. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ pid_t td_dbg_forked; /* (c) Child pid for debugger. */ -#define td_endzero td_rqindex +#define td_endzero td_sigmask -/* Copied during fork1() or thread_sched_upcall(). */ +/* Copied during fork1() or create_thread(). */ #define td_startcopy td_endzero + sigset_t td_sigmask; /* (c) Current signal mask. */ u_char td_rqindex; /* (t) Run queue index. */ u_char td_base_pri; /* (t) Thread base kernel priority. */ u_char td_priority; /* (t) Thread active priority. */ @@ -285,7 +285,7 @@ struct thread { #define td_endcopy td_pcb /* - * Fields that must be manually set in fork1() or thread_sched_upcall() + * Fields that must be manually set in fork1() or create_thread() * or already have been set in the allocator, constructor, etc. */ struct pcb *td_pcb; /* (k) Kernel VA of pcb and kstack. */