diff options
author | julian <julian@FreeBSD.org> | 1999-01-07 21:23:50 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1999-01-07 21:23:50 +0000 |
commit | a7b385889ec602ef4648e627bcb67bf0fd8d539d (patch) | |
tree | 1272156e48dfdcff77f2732eaba7e964197de3bb /sys/vm/vm_glue.c | |
parent | 4cb6632c89aa14d9544a8ffe3e463e6e21aec1f3 (diff) | |
download | FreeBSD-src-a7b385889ec602ef4648e627bcb67bf0fd8d539d.zip FreeBSD-src-a7b385889ec602ef4648e627bcb67bf0fd8d539d.tar.gz |
Changes to the LINUX_THREADS support to only allocate extra memory for
shared signal handling when there is shared signal handling being
used.
This removes the main objection to making the shared signal handling
a standard ability in rfork() and friends and 'unconditionalising'
this code. (i.e. the allocation of an extra 328 bytes per process).
Signal handling information remains in the U area until such a time as
it's reference count would be incremented to > 1. At that point a new
struct is malloc'd and maintained in KVM so that it can be shared between
the processes (threads) using it.
A function to check the reference count and move the struct back to the U
area when it drops back to 1 is also supplied. Signal information is
therefore now swapable for all processes that are not sharing that
information with other processes. THis should addres the concerns raised
by Garrett and others.
Submitted by: "Richard Seaman, Jr." <dick@tar.com>
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r-- | sys/vm/vm_glue.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index ce4786f..ec844db 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -59,7 +59,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_glue.c,v 1.78 1998/12/19 02:55:34 julian Exp $ + * $Id: vm_glue.c,v 1.79 1998/12/19 08:23:31 julian Exp $ */ #include "opt_rlimit.h" @@ -243,8 +243,17 @@ vm_fork(p1, p2, flags) * p_stats currently points at fields in the user struct * but not at &u, instead at p_addr. Copy parts of * p_stats; zero the rest of p_stats (statistics). + * + * If procsig->ps_refcnt is 1 and p2->p_sigacts is NULL we dont' need + * to share sigacts, so we use the up->u_sigacts. */ p2->p_stats = &up->u_stats; + if (p2->p_sigacts == NULL) { + if (p2->p_procsig->ps_refcnt != 1) + printf ("PID:%d NULL sigacts with refcnt not 1!\n",p2->p_pid); + p2->p_sigacts = &up->u_sigacts; + up->u_sigacts = *p1->p_sigacts; + } #endif /* COMPAT_LINUX_THREADS */ bzero(&up->u_stats.pstat_startzero, (unsigned) ((caddr_t) &up->u_stats.pstat_endzero - |