summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-11-16 20:31:58 +0000
committerphk <phk@FreeBSD.org>1999-11-16 20:31:58 +0000
commitcc6b664e2eb821b39837e7bb980e5ee87e201491 (patch)
tree65eeb4add32e588f36f28e2a0bb819c17a67ff70 /sys/kern/kern_exit.c
parent47e5f46c7642e6d8e2ed20c8afca59596d3c2dc1 (diff)
downloadFreeBSD-src-cc6b664e2eb821b39837e7bb980e5ee87e201491.zip
FreeBSD-src-cc6b664e2eb821b39837e7bb980e5ee87e201491.tar.gz
Introduce commandline caching in the kernel.
This fixes some nasty procfs problems for SMP, makes ps(1) run much faster, and makes ps(1) even less dependent on /proc which will aid chroot and jails alike. To disable this facility and revert to previous behaviour: sysctl -w kern.ps_arg_cache_limit=0 For full details see the current@FreeBSD.org mail-archives.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 6fe2171..6c00e43 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -494,6 +494,12 @@ loop:
}
/*
+ * Remove unused arguments
+ */
+ if (p->p_args && --p->p_args->ar_ref == 0)
+ FREE(p->p_args, M_PARGS);
+
+ /*
* Finally finished with old proc entry.
* Unlink it from its process group and free it.
*/
OpenPOWER on IntegriCloud