diff options
author | dchagin <dchagin@FreeBSD.org> | 2015-05-24 17:07:10 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2015-05-24 17:07:10 +0000 |
commit | ce8b8e15a8aa4bad9b51244c4a356d2304795661 (patch) | |
tree | b2a740e9c4e39612f219400c521ef937eecc793b /sys/compat/linux/linux_emul.c | |
parent | b63988daf78b5d4bcfd92d3158279569a8a83fb1 (diff) | |
download | FreeBSD-src-ce8b8e15a8aa4bad9b51244c4a356d2304795661.zip FreeBSD-src-ce8b8e15a8aa4bad9b51244c4a356d2304795661.tar.gz |
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
Diffstat (limited to 'sys/compat/linux/linux_emul.c')
-rw-r--r-- | sys/compat/linux/linux_emul.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 912baaf..2102c41 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -89,8 +89,6 @@ linux_proc_init(struct thread *td, struct thread *newtd, int flags) 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, struct thread *newtd, int flags) 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, struct thread *newtd, int flags) } } - em->child_clear_tid = NULL; - em->child_set_tid = NULL; } void |