Author: dchagin
Date: Sun May 24 17:07:10 2015
New Revision: 283454
URL: https://svnweb.freebsd.org/changeset/base/283454

Log:
  Avoid unnecessary em zeroing in non-exec path
  as it already zeroed by malloc with M_ZERO flag
  and move zeroing to the proper place in exec path.
  
  Differential Revision:        https://reviews.freebsd.org/D1462
  Reviewed by:  trasz

Modified:
  head/sys/compat/linux/linux_emul.c

Modified: head/sys/compat/linux/linux_emul.c
==============================================================================
--- head/sys/compat/linux/linux_emul.c  Sun May 24 17:05:59 2015        
(r283453)
+++ head/sys/compat/linux/linux_emul.c  Sun May 24 17:07:10 2015        
(r283454)
@@ -89,8 +89,6 @@ linux_proc_init(struct thread *td, struc
        if (newtd != NULL) {
                /* non-exec call */
                em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO);
-               em->pdeath_signal = 0;
-               em->robust_futexes = NULL;
                if (flags & LINUX_CLONE_THREAD) {
                        LINUX_CTR1(proc_init, "thread newtd(%d)",
                            newtd->td_tid);
@@ -117,6 +115,11 @@ linux_proc_init(struct thread *td, struc
                KASSERT(em != NULL, ("proc_init: emuldata not found in exec 
case.\n"));
 
                em->em_tid = td->td_proc->p_pid;
+               em->flags = 0;
+               em->pdeath_signal = 0;
+               em->robust_futexes = NULL;
+               em->child_clear_tid = NULL;
+               em->child_set_tid = NULL;
 
                 /* epoll should be destroyed in a case of exec. */
                pem = pem_find(td->td_proc);
@@ -129,8 +132,6 @@ linux_proc_init(struct thread *td, struc
                }
        }
 
-       em->child_clear_tid = NULL;
-       em->child_set_tid = NULL;
 }
 
 void 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to